| Index: chrome/app/chrome_main_delegate.cc
|
| diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc
|
| index 9cb226247513989e4358105f851cd02f7899e750..9f2905732aa38e304c3083d1a4e9b146b15afced 100644
|
| --- a/chrome/app/chrome_main_delegate.cc
|
| +++ b/chrome/app/chrome_main_delegate.cc
|
| @@ -58,7 +58,7 @@
|
| #include <atlbase.h>
|
| #include <malloc.h>
|
| #include <algorithm>
|
| -#include "chrome/app/close_handle_hook_win.h"
|
| +#include "base/debug/close_handle_hook_win.h"
|
| #include "chrome/common/child_process_logging.h"
|
| #include "chrome/common/v8_breakpad_support_win.h"
|
| #include "components/crash/content/app/crashpad.h"
|
| @@ -193,6 +193,22 @@ bool IsSandboxedProcess() {
|
| return is_sandboxed_process_func && is_sandboxed_process_func();
|
| }
|
|
|
| +bool UseHooks() {
|
| +#if defined(ARCH_CPU_X86_64)
|
| + return false;
|
| +#elif defined(NDEBUG)
|
| + version_info::Channel channel = chrome::GetChannel();
|
| + if (channel == version_info::Channel::CANARY ||
|
| + channel == version_info::Channel::DEV) {
|
| + return true;
|
| + }
|
| +
|
| + return false;
|
| +#else // NDEBUG
|
| + return true;
|
| +#endif
|
| +}
|
| +
|
| #endif // defined(OS_WIN)
|
|
|
| #if defined(OS_LINUX)
|
| @@ -502,7 +518,11 @@ bool ChromeMainDelegate::BasicStartupComplete(int* exit_code) {
|
| return true;
|
| }
|
|
|
| - InstallHandleHooks();
|
| + if (UseHooks())
|
| + base::debug::InstallHandleHooks();
|
| + else
|
| + base::win::DisableHandleVerifier();
|
| +
|
| #endif
|
|
|
| chrome::RegisterPathProvider();
|
| @@ -892,7 +912,7 @@ void ChromeMainDelegate::ProcessExiting(const std::string& process_type) {
|
| #endif // !defined(OS_ANDROID)
|
|
|
| #if defined(OS_WIN)
|
| - RemoveHandleHooks();
|
| + base::debug::RemoveHandleHooks();
|
| #endif
|
| }
|
|
|
|
|