| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 } | 187 } |
| 188 | 188 |
| 189 bool IsSandboxedProcess() { | 189 bool IsSandboxedProcess() { |
| 190 typedef bool (*IsSandboxedProcessFunc)(); | 190 typedef bool (*IsSandboxedProcessFunc)(); |
| 191 IsSandboxedProcessFunc is_sandboxed_process_func = | 191 IsSandboxedProcessFunc is_sandboxed_process_func = |
| 192 reinterpret_cast<IsSandboxedProcessFunc>( | 192 reinterpret_cast<IsSandboxedProcessFunc>( |
| 193 GetProcAddress(GetModuleHandle(NULL), "IsSandboxedProcess")); | 193 GetProcAddress(GetModuleHandle(NULL), "IsSandboxedProcess")); |
| 194 return is_sandboxed_process_func && is_sandboxed_process_func(); | 194 return is_sandboxed_process_func && is_sandboxed_process_func(); |
| 195 } | 195 } |
| 196 | 196 |
| 197 bool UseHandleVerifier() { | 197 bool UseHooks() { |
| 198 #if defined(ARCH_CPU_X86_64) | 198 #if defined(ARCH_CPU_X86_64) |
| 199 return false; | 199 return false; |
| 200 #elif defined(NDEBUG) | 200 #elif defined(NDEBUG) |
| 201 version_info::Channel channel = chrome::GetChannel(); | 201 version_info::Channel channel = chrome::GetChannel(); |
| 202 if (channel == version_info::Channel::CANARY || | 202 if (channel == version_info::Channel::CANARY || |
| 203 channel == version_info::Channel::DEV) { | 203 channel == version_info::Channel::DEV) { |
| 204 return true; | 204 return true; |
| 205 } | 205 } |
| 206 | 206 |
| 207 return false; | 207 return false; |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 #endif | 512 #endif |
| 513 #endif // OS_POSIX | 513 #endif // OS_POSIX |
| 514 | 514 |
| 515 #if defined(OS_WIN) | 515 #if defined(OS_WIN) |
| 516 // Must do this before any other usage of command line! | 516 // Must do this before any other usage of command line! |
| 517 if (HasDeprecatedArguments(command_line.GetCommandLineString())) { | 517 if (HasDeprecatedArguments(command_line.GetCommandLineString())) { |
| 518 *exit_code = 1; | 518 *exit_code = 1; |
| 519 return true; | 519 return true; |
| 520 } | 520 } |
| 521 | 521 |
| 522 if (UseHandleVerifier()) | 522 if (UseHooks()) |
| 523 base::debug::InstallHandleHooks(); | 523 base::debug::InstallHandleHooks(); |
| 524 else | 524 else |
| 525 base::win::DisableHandleVerifier(); | 525 base::win::DisableHandleVerifier(); |
| 526 | 526 |
| 527 #endif | 527 #endif |
| 528 | 528 |
| 529 chrome::RegisterPathProvider(); | 529 chrome::RegisterPathProvider(); |
| 530 #if defined(OS_CHROMEOS) | 530 #if defined(OS_CHROMEOS) |
| 531 chromeos::RegisterPathProvider(); | 531 chromeos::RegisterPathProvider(); |
| 532 #endif | 532 #endif |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1016 case version_info::Channel::CANARY: | 1016 case version_info::Channel::CANARY: |
| 1017 return true; | 1017 return true; |
| 1018 case version_info::Channel::DEV: | 1018 case version_info::Channel::DEV: |
| 1019 case version_info::Channel::BETA: | 1019 case version_info::Channel::BETA: |
| 1020 case version_info::Channel::STABLE: | 1020 case version_info::Channel::STABLE: |
| 1021 default: | 1021 default: |
| 1022 // Don't enable instrumentation. | 1022 // Don't enable instrumentation. |
| 1023 return false; | 1023 return false; |
| 1024 } | 1024 } |
| 1025 } | 1025 } |
| OLD | NEW |