Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1856)

Unified Diff: chrome/app/chrome_main_delegate.cc

Issue 1549633005: Move CloseHandle hook into base/debug. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/BUILD.gn ('k') | chrome/app/close_handle_hook_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
}
« no previous file with comments | « chrome/app/BUILD.gn ('k') | chrome/app/close_handle_hook_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698