Index: chrome/app/main_dll_loader_win.cc |
diff --git a/chrome/app/main_dll_loader_win.cc b/chrome/app/main_dll_loader_win.cc |
index ba14dba3bcc3cdb209ddf0a1ee79cb5f50530abe..08ce84861ac55e95e16c2850eac4148299aa6fa1 100644 |
--- a/chrome/app/main_dll_loader_win.cc |
+++ b/chrome/app/main_dll_loader_win.cc |
@@ -21,6 +21,7 @@ |
#include "base/strings/stringprintf.h" |
#include "base/strings/utf_string_conversions.h" |
#include "base/trace_event/trace_event.h" |
+#include "base/win/metro.h" |
#include "base/win/scoped_handle.h" |
#include "base/win/windows_version.h" |
#include "chrome/app/chrome_crash_reporter_client.h" |
@@ -39,8 +40,8 @@ |
#include "chrome/installer/util/install_util.h" |
#include "chrome/installer/util/module_util_win.h" |
#include "chrome/installer/util/util_constants.h" |
-#include "components/crash/content/app/breakpad_win.h" |
#include "components/crash/content/app/crash_reporter_client.h" |
+#include "components/crash/content/app/crashpad.h" |
#include "content/public/app/sandbox_helper_win.h" |
#include "content/public/common/content_switches.h" |
#include "sandbox/win/src/sandbox.h" |
@@ -51,9 +52,6 @@ typedef int (*DLL_MAIN)(HINSTANCE, sandbox::SandboxInterfaceInfo*); |
typedef void (*RelaunchChromeBrowserWithNewCommandLineIfNeededFunc)(); |
-base::LazyInstance<ChromeCrashReporterClient>::Leaky g_chrome_crash_client = |
- LAZY_INSTANCE_INITIALIZER; |
- |
// Loads |module| after setting the CWD to |module|'s directory. Returns a |
// reference to the loaded module on success, or null on error. |
HMODULE LoadModuleWithDirectory(const base::FilePath& module, bool pre_read) { |
@@ -80,11 +78,6 @@ void ClearDidRun(const base::FilePath& dll_path) { |
GoogleUpdateSettings::UpdateDidRunState(false, system_level); |
} |
-bool InMetroMode() { |
- return (wcsstr( |
- ::GetCommandLineW(), L" -ServerName:DefaultBrowserServer") != nullptr); |
-} |
- |
typedef int (*InitMetro)(); |
} // namespace |
@@ -92,7 +85,7 @@ typedef int (*InitMetro)(); |
//============================================================================= |
MainDllLoader::MainDllLoader() |
- : dll_(nullptr), metro_mode_(InMetroMode()) { |
+ : dll_(nullptr), metro_mode_(base::win::IsMetroProcess()) { |
} |
MainDllLoader::~MainDllLoader() { |
@@ -204,18 +197,6 @@ int MainDllLoader::Launch(HINSTANCE instance) { |
sandbox::SandboxInterfaceInfo sandbox_info = {0}; |
content::InitializeSandboxInfo(&sandbox_info); |
- crash_reporter::SetCrashReporterClient(g_chrome_crash_client.Pointer()); |
- bool exit_now = true; |
- if (process_type_.empty()) { |
- if (breakpad::ShowRestartDialogIfCrashed(&exit_now)) { |
- // We restarted because of a previous crash. Ask user if we should |
- // Relaunch. Only for the browser process. See crbug.com/132119. |
- if (exit_now) |
- return content::RESULT_CODE_NORMAL_EXIT; |
- } |
- } |
- breakpad::InitCrashReporter(process_type_); |
- |
dll_ = Load(&version, &file); |
if (!dll_) |
return chrome::RESULT_CODE_MISSING_DATA; |
@@ -228,12 +209,6 @@ int MainDllLoader::Launch(HINSTANCE instance) { |
reinterpret_cast<DLL_MAIN>(::GetProcAddress(dll_, "ChromeMain")); |
int rc = chrome_main(instance, &sandbox_info); |
rc = OnBeforeExit(rc, file); |
- // Sandboxed processes close some system DLL handles after lockdown so ignore |
- // EXCEPTION_INVALID_HANDLE generated on Windows 10 during shutdown of these |
- // processes. |
- // TODO(wfh): Check whether MS have fixed this in Win10 RTM. crbug.com/456193 |
- if (base::win::GetVersion() >= base::win::VERSION_WIN10) |
- breakpad::ConsumeInvalidHandleExceptions(); |
return rc; |
} |
@@ -275,7 +250,13 @@ void ChromeDllLoader::OnBeforeLaunch(const std::string& process_type, |
RecordDidRun(dll_path); |
// Launch the watcher process if stats collection consent has been granted. |
- if (g_chrome_crash_client.Get().GetCollectStatsConsent()) { |
+#if defined(GOOGLE_CHROME_BUILD) |
+ const bool stats_collection_consent = |
+ GoogleUpdateSettings::GetCollectStatsConsent(); |
+#else |
+ const bool stats_collection_consent = false; |
+#endif |
+ if (stats_collection_consent) { |
base::FilePath exe_path; |
if (PathService::Get(base::FILE_EXE, &exe_path)) { |
chrome_watcher_client_.reset(new ChromeWatcherClient( |