Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/app/chrome_main_delegate.h" | 5 #include "chrome/app/chrome_main_delegate.h" |
| 6 | 6 |
| 7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/cpu.h" | 9 #include "base/cpu.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 49 #include "ui/base/resource/resource_bundle.h" | 49 #include "ui/base/resource/resource_bundle.h" |
| 50 #include "ui/base/ui_base_switches.h" | 50 #include "ui/base/ui_base_switches.h" |
| 51 | 51 |
| 52 #if defined(OS_WIN) | 52 #if defined(OS_WIN) |
| 53 #include <atlbase.h> | 53 #include <atlbase.h> |
| 54 #include <malloc.h> | 54 #include <malloc.h> |
| 55 #include <algorithm> | 55 #include <algorithm> |
| 56 #include "chrome/app/close_handle_hook_win.h" | 56 #include "chrome/app/close_handle_hook_win.h" |
| 57 #include "chrome/common/child_process_logging.h" | 57 #include "chrome/common/child_process_logging.h" |
| 58 #include "chrome/common/v8_breakpad_support_win.h" | 58 #include "chrome/common/v8_breakpad_support_win.h" |
| 59 #include "components/crash/content/app/crashpad.h" | |
| 59 #include "sandbox/win/src/sandbox.h" | 60 #include "sandbox/win/src/sandbox.h" |
| 60 #include "ui/base/resource/resource_bundle_win.h" | 61 #include "ui/base/resource/resource_bundle_win.h" |
| 61 #endif | 62 #endif |
| 62 | 63 |
| 63 #if defined(OS_MACOSX) | 64 #if defined(OS_MACOSX) |
| 64 #include "base/mac/foundation_util.h" | 65 #include "base/mac/foundation_util.h" |
| 65 #include "chrome/app/chrome_main_mac.h" | 66 #include "chrome/app/chrome_main_mac.h" |
| 66 #include "chrome/browser/mac/relauncher.h" | 67 #include "chrome/browser/mac/relauncher.h" |
| 67 #include "chrome/common/mac/cfbundle_blocker.h" | 68 #include "chrome/common/mac/cfbundle_blocker.h" |
| 68 #include "components/crash/content/app/crashpad_mac.h" | 69 #include "components/crash/content/app/crashpad.h" |
| 69 #include "components/crash/core/common/objc_zombie.h" | 70 #include "components/crash/core/common/objc_zombie.h" |
| 70 #include "ui/base/l10n/l10n_util_mac.h" | 71 #include "ui/base/l10n/l10n_util_mac.h" |
| 71 #endif | 72 #endif |
| 72 | 73 |
| 73 #if defined(OS_POSIX) | 74 #if defined(OS_POSIX) |
| 74 #include <locale.h> | 75 #include <locale.h> |
| 75 #include <signal.h> | 76 #include <signal.h> |
| 76 #include "chrome/app/chrome_crash_reporter_client.h" | 77 #include "chrome/app/chrome_crash_reporter_client.h" |
| 77 #include "components/crash/content/app/crash_reporter_client.h" | 78 #include "components/crash/content/app/crash_reporter_client.h" |
| 78 #endif | 79 #endif |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 426 } | 427 } |
| 427 | 428 |
| 428 bool ChromeMainDelegate::BasicStartupComplete(int* exit_code) { | 429 bool ChromeMainDelegate::BasicStartupComplete(int* exit_code) { |
| 429 #if defined(OS_CHROMEOS) | 430 #if defined(OS_CHROMEOS) |
| 430 chromeos::BootTimesRecorder::Get()->SaveChromeMainStats(); | 431 chromeos::BootTimesRecorder::Get()->SaveChromeMainStats(); |
| 431 #endif | 432 #endif |
| 432 | 433 |
| 433 const base::CommandLine& command_line = | 434 const base::CommandLine& command_line = |
| 434 *base::CommandLine::ForCurrentProcess(); | 435 *base::CommandLine::ForCurrentProcess(); |
| 435 | 436 |
| 436 | |
| 437 #if defined(OS_WIN) | 437 #if defined(OS_WIN) |
| 438 // Browser should not be sandboxed. | 438 // Browser should not be sandboxed. |
| 439 const bool is_browser = !command_line.HasSwitch(switches::kProcessType); | 439 const bool is_browser = !command_line.HasSwitch(switches::kProcessType); |
| 440 if (is_browser && IsSandboxedProcess()) { | 440 if (is_browser && IsSandboxedProcess()) { |
| 441 *exit_code = chrome::RESULT_CODE_INVALID_SANDBOX_STATE; | 441 *exit_code = chrome::RESULT_CODE_INVALID_SANDBOX_STATE; |
| 442 return true; | 442 return true; |
| 443 } | 443 } |
| 444 #endif | 444 #endif |
| 445 | 445 |
| 446 #if defined(OS_MACOSX) | 446 #if defined(OS_MACOSX) |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 476 #if defined(OS_WIN) | 476 #if defined(OS_WIN) |
| 477 // Must do this before any other usage of command line! | 477 // Must do this before any other usage of command line! |
| 478 if (HasDeprecatedArguments(command_line.GetCommandLineString())) { | 478 if (HasDeprecatedArguments(command_line.GetCommandLineString())) { |
| 479 *exit_code = 1; | 479 *exit_code = 1; |
| 480 return true; | 480 return true; |
| 481 } | 481 } |
| 482 | 482 |
| 483 InstallHandleHooks(); | 483 InstallHandleHooks(); |
| 484 #endif | 484 #endif |
| 485 | 485 |
| 486 #if defined(OS_WIN) && !defined(COMPONENT_BUILD) | |
|
Mark Mentovai
2015/11/10 17:21:17
Not sure what this is about.
| |
| 486 chrome::RegisterPathProvider(); | 487 chrome::RegisterPathProvider(); |
| 488 #endif | |
| 487 #if defined(OS_CHROMEOS) | 489 #if defined(OS_CHROMEOS) |
| 488 chromeos::RegisterPathProvider(); | 490 chromeos::RegisterPathProvider(); |
| 489 #endif | 491 #endif |
| 490 #if !defined(DISABLE_NACL) && defined(OS_LINUX) | 492 #if !defined(DISABLE_NACL) && defined(OS_LINUX) |
| 491 nacl::RegisterPathProvider(); | 493 nacl::RegisterPathProvider(); |
| 492 #endif | 494 #endif |
| 493 | 495 |
| 494 ContentSettingsPattern::SetNonWildcardDomainNonPortScheme( | 496 ContentSettingsPattern::SetNonWildcardDomainNonPortScheme( |
| 495 extensions::kExtensionScheme); | 497 extensions::kExtensionScheme); |
| 496 | 498 |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 965 case version_info::Channel::CANARY: | 967 case version_info::Channel::CANARY: |
| 966 return true; | 968 return true; |
| 967 case version_info::Channel::DEV: | 969 case version_info::Channel::DEV: |
| 968 case version_info::Channel::BETA: | 970 case version_info::Channel::BETA: |
| 969 case version_info::Channel::STABLE: | 971 case version_info::Channel::STABLE: |
| 970 default: | 972 default: |
| 971 // Don't enable instrumentation. | 973 // Don't enable instrumentation. |
| 972 return false; | 974 return false; |
| 973 } | 975 } |
| 974 } | 976 } |
| OLD | NEW |