| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 #include "ui/base/resource/resource_bundle.h" | 48 #include "ui/base/resource/resource_bundle.h" |
| 49 #include "ui/base/ui_base_switches.h" | 49 #include "ui/base/ui_base_switches.h" |
| 50 | 50 |
| 51 #if defined(OS_WIN) | 51 #if defined(OS_WIN) |
| 52 #include <atlbase.h> | 52 #include <atlbase.h> |
| 53 #include <malloc.h> | 53 #include <malloc.h> |
| 54 #include <algorithm> | 54 #include <algorithm> |
| 55 #include "chrome/app/close_handle_hook_win.h" | 55 #include "chrome/app/close_handle_hook_win.h" |
| 56 #include "chrome/common/child_process_logging.h" | 56 #include "chrome/common/child_process_logging.h" |
| 57 #include "chrome/common/v8_breakpad_support_win.h" | 57 #include "chrome/common/v8_breakpad_support_win.h" |
| 58 #include "components/crash/content/app/crashpad.h" |
| 58 #include "sandbox/win/src/sandbox.h" | 59 #include "sandbox/win/src/sandbox.h" |
| 59 #include "ui/base/resource/resource_bundle_win.h" | 60 #include "ui/base/resource/resource_bundle_win.h" |
| 60 #endif | 61 #endif |
| 61 | 62 |
| 62 #if defined(OS_MACOSX) | 63 #if defined(OS_MACOSX) |
| 63 #include "base/mac/foundation_util.h" | 64 #include "base/mac/foundation_util.h" |
| 64 #include "chrome/app/chrome_main_mac.h" | 65 #include "chrome/app/chrome_main_mac.h" |
| 65 #include "chrome/browser/mac/relauncher.h" | 66 #include "chrome/browser/mac/relauncher.h" |
| 66 #include "chrome/common/mac/cfbundle_blocker.h" | 67 #include "chrome/common/mac/cfbundle_blocker.h" |
| 67 #include "components/crash/content/app/crashpad_mac.h" | 68 #include "components/crash/content/app/crashpad.h" |
| 68 #include "components/crash/core/common/objc_zombie.h" | 69 #include "components/crash/core/common/objc_zombie.h" |
| 69 #include "ui/base/l10n/l10n_util_mac.h" | 70 #include "ui/base/l10n/l10n_util_mac.h" |
| 70 #endif | 71 #endif |
| 71 | 72 |
| 72 #if defined(OS_POSIX) | 73 #if defined(OS_POSIX) |
| 73 #include <locale.h> | 74 #include <locale.h> |
| 74 #include <signal.h> | 75 #include <signal.h> |
| 75 #include "chrome/app/chrome_crash_reporter_client.h" | 76 #include "chrome/app/chrome_crash_reporter_client.h" |
| 76 #include "components/crash/content/app/crash_reporter_client.h" | 77 #include "components/crash/content/app/crash_reporter_client.h" |
| 77 #endif | 78 #endif |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 } | 442 } |
| 442 | 443 |
| 443 bool ChromeMainDelegate::BasicStartupComplete(int* exit_code) { | 444 bool ChromeMainDelegate::BasicStartupComplete(int* exit_code) { |
| 444 #if defined(OS_CHROMEOS) | 445 #if defined(OS_CHROMEOS) |
| 445 chromeos::BootTimesRecorder::Get()->SaveChromeMainStats(); | 446 chromeos::BootTimesRecorder::Get()->SaveChromeMainStats(); |
| 446 #endif | 447 #endif |
| 447 | 448 |
| 448 const base::CommandLine& command_line = | 449 const base::CommandLine& command_line = |
| 449 *base::CommandLine::ForCurrentProcess(); | 450 *base::CommandLine::ForCurrentProcess(); |
| 450 | 451 |
| 451 | |
| 452 #if defined(OS_WIN) | 452 #if defined(OS_WIN) |
| 453 // Browser should not be sandboxed. | 453 // Browser should not be sandboxed. |
| 454 const bool is_browser = !command_line.HasSwitch(switches::kProcessType); | 454 const bool is_browser = !command_line.HasSwitch(switches::kProcessType); |
| 455 if (is_browser && IsSandboxedProcess()) { | 455 if (is_browser && IsSandboxedProcess()) { |
| 456 *exit_code = chrome::RESULT_CODE_INVALID_SANDBOX_STATE; | 456 *exit_code = chrome::RESULT_CODE_INVALID_SANDBOX_STATE; |
| 457 return true; | 457 return true; |
| 458 } | 458 } |
| 459 #endif | 459 #endif |
| 460 | 460 |
| 461 #if defined(OS_MACOSX) | 461 #if defined(OS_MACOSX) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 491 #if defined(OS_WIN) | 491 #if defined(OS_WIN) |
| 492 // Must do this before any other usage of command line! | 492 // Must do this before any other usage of command line! |
| 493 if (HasDeprecatedArguments(command_line.GetCommandLineString())) { | 493 if (HasDeprecatedArguments(command_line.GetCommandLineString())) { |
| 494 *exit_code = 1; | 494 *exit_code = 1; |
| 495 return true; | 495 return true; |
| 496 } | 496 } |
| 497 | 497 |
| 498 InstallHandleHooks(); | 498 InstallHandleHooks(); |
| 499 #endif | 499 #endif |
| 500 | 500 |
| 501 #if defined(OS_WIN) && !defined(COMPONENT_BUILD) |
| 501 chrome::RegisterPathProvider(); | 502 chrome::RegisterPathProvider(); |
| 503 #endif |
| 502 #if defined(OS_CHROMEOS) | 504 #if defined(OS_CHROMEOS) |
| 503 chromeos::RegisterPathProvider(); | 505 chromeos::RegisterPathProvider(); |
| 504 #endif | 506 #endif |
| 505 #if !defined(DISABLE_NACL) && defined(OS_LINUX) | 507 #if !defined(DISABLE_NACL) && defined(OS_LINUX) |
| 506 nacl::RegisterPathProvider(); | 508 nacl::RegisterPathProvider(); |
| 507 #endif | 509 #endif |
| 508 | 510 |
| 509 ContentSettingsPattern::SetNonWildcardDomainNonPortScheme( | 511 ContentSettingsPattern::SetNonWildcardDomainNonPortScheme( |
| 510 extensions::kExtensionScheme); | 512 extensions::kExtensionScheme); |
| 511 | 513 |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 case version_info::Channel::CANARY: | 982 case version_info::Channel::CANARY: |
| 981 return true; | 983 return true; |
| 982 case version_info::Channel::DEV: | 984 case version_info::Channel::DEV: |
| 983 case version_info::Channel::BETA: | 985 case version_info::Channel::BETA: |
| 984 case version_info::Channel::STABLE: | 986 case version_info::Channel::STABLE: |
| 985 default: | 987 default: |
| 986 // Don't enable instrumentation. | 988 // Don't enable instrumentation. |
| 987 return false; | 989 return false; |
| 988 } | 990 } |
| 989 } | 991 } |
| OLD | NEW |