diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-06 12:56:28 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-06 12:56:28 +0000 |
commit | aee861165564fe84986e5fb895b82e93c19fa8c9 (patch) | |
tree | 1c67dc832c71f77bc344498d66559ed4b7afd63c /chrome | |
parent | 1a82f7376ac4e974f9030358bc1fdf1d9f56a579 (diff) | |
download | chromium_src-aee861165564fe84986e5fb895b82e93c19fa8c9.zip chromium_src-aee861165564fe84986e5fb895b82e93c19fa8c9.tar.gz chromium_src-aee861165564fe84986e5fb895b82e93c19fa8c9.tar.bz2 |
[breakpad] remove dependency on content_switches.cc
R=joi@chromium.org, scottmg@chromium.org
BUG=none
Review URL: https://codereview.chromium.org/104593008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239179 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/chrome_breakpad_client.cc | 9 | ||||
-rw-r--r-- | chrome/app/chrome_breakpad_client.h | 3 | ||||
-rw-r--r-- | chrome/app/chrome_exe_main_win.cc | 12 | ||||
-rw-r--r-- | chrome/app/chrome_main_delegate.cc | 17 | ||||
-rw-r--r-- | chrome/app/client_util.cc | 5 | ||||
-rw-r--r-- | chrome/browser/chromeos/login/wizard_controller.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/first_run_dialog.mm | 4 | ||||
-rw-r--r-- | chrome/browser/ui/gtk/first_run_dialog.cc | 2 | ||||
-rw-r--r-- | chrome/nacl/nacl_exe_win_64.cc | 2 |
9 files changed, 40 insertions, 16 deletions
diff --git a/chrome/app/chrome_breakpad_client.cc b/chrome/app/chrome_breakpad_client.cc index 36b50f9..84a6977 100644 --- a/chrome/app/chrome_breakpad_client.cc +++ b/chrome/app/chrome_breakpad_client.cc @@ -380,4 +380,13 @@ int ChromeBreakpadClient::GetAndroidMinidumpDescriptor() { } #endif +bool ChromeBreakpadClient::EnableBreakpadForProcess( + const std::string& process_type) { + return process_type == switches::kRendererProcess || + process_type == switches::kPluginProcess || + process_type == switches::kPpapiPluginProcess || + process_type == switches::kZygoteProcess || + process_type == switches::kGpuProcess; +} + } // namespace chrome diff --git a/chrome/app/chrome_breakpad_client.h b/chrome/app/chrome_breakpad_client.h index 10d0980..7e79a09 100644 --- a/chrome/app/chrome_breakpad_client.h +++ b/chrome/app/chrome_breakpad_client.h @@ -68,6 +68,9 @@ class ChromeBreakpadClient : public breakpad::BreakpadClient { virtual void InstallAdditionalFilters(BreakpadRef breakpad) OVERRIDE; #endif + virtual bool EnableBreakpadForProcess( + const std::string& process_type) OVERRIDE; + private: DISALLOW_COPY_AND_ASSIGN(ChromeBreakpadClient); }; diff --git a/chrome/app/chrome_exe_main_win.cc b/chrome/app/chrome_exe_main_win.cc index 591ec7a..68a2519 100644 --- a/chrome/app/chrome_exe_main_win.cc +++ b/chrome/app/chrome_exe_main_win.cc @@ -47,9 +47,15 @@ int RunChrome(HINSTANCE instance) { bool exit_now = true; // We restarted because of a previous crash. Ask user if we should relaunch. - if (breakpad::ShowRestartDialogIfCrashed(&exit_now)) { - if (exit_now) - return content::RESULT_CODE_NORMAL_EXIT; + // Only show this for the browser process. See crbug.com/132119. + const std::string process_type = + CommandLine::ForCurrentProcess()->GetSwitchValueASCII( + switches::kProcessType); + if (process_type.empty()) { + if (breakpad::ShowRestartDialogIfCrashed(&exit_now)) { + if (exit_now) + return content::RESULT_CODE_NORMAL_EXIT; + } } // Initialize the sandbox services. diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc index c655619..f75032e 100644 --- a/chrome/app/chrome_main_delegate.cc +++ b/chrome/app/chrome_main_delegate.cc @@ -478,7 +478,7 @@ void ChromeMainDelegate::InitMacCrashReporter(const CommandLine& command_line, // CommandLine::Init() and chrome::RegisterPathProvider(). Ideally, // Breakpad initialization could occur sooner, preferably even before the // framework dylib is even loaded, to catch potential early crashes. - breakpad::InitCrashReporter(); + breakpad::InitCrashReporter(process_type); #if defined(NDEBUG) bool is_debug_build = false; @@ -555,7 +555,7 @@ void ChromeMainDelegate::InitMacCrashReporter(const CommandLine& command_line, } if (breakpad::IsCrashReporterEnabled()) - breakpad::InitCrashProcessInfo(); + breakpad::InitCrashProcessInfo(process_type); } #endif // defined(OS_MACOSX) @@ -708,11 +708,11 @@ void ChromeMainDelegate::PreSandboxStartup() { if (process_type != switches::kZygoteProcess) { #if defined(OS_ANDROID) if (process_type.empty()) - breakpad::InitCrashReporter(); + breakpad::InitCrashReporter(process_type); else - breakpad::InitNonBrowserCrashReporterForAndroid(); + breakpad::InitNonBrowserCrashReporterForAndroid(process_type); #else // !defined(OS_ANDROID) - breakpad::InitCrashReporter(); + breakpad::InitCrashReporter(process_type); #endif // defined(OS_ANDROID) } #endif // defined(OS_POSIX) && !defined(OS_MACOSX) @@ -818,10 +818,13 @@ void ChromeMainDelegate::ZygoteForked() { // Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets // this up for the browser process in a different manner. - breakpad::InitCrashReporter(); + const CommandLine* command_line = CommandLine::ForCurrentProcess(); + std::string process_type = + command_line->GetSwitchValueASCII(switches::kProcessType); + breakpad::InitCrashReporter(process_type); // Reset the command line for the newly spawned process. - crash_keys::SetSwitchesFromCommandLine(CommandLine::ForCurrentProcess()); + crash_keys::SetSwitchesFromCommandLine(command_line); } #endif // OS_MACOSX diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc index e3d495e..0258371 100644 --- a/chrome/app/client_util.cc +++ b/chrome/app/client_util.cc @@ -286,7 +286,10 @@ int MainDllLoader::Launch(HINSTANCE instance, // widely deployed. env->UnSetVar(env_vars::kGoogleUpdateIsMachineEnvVar); - breakpad::InitCrashReporter(); + const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); + std::string process_type = + cmd_line.GetSwitchValueASCII(switches::kProcessType); + breakpad::InitCrashReporter(process_type); OnBeforeLaunch(file); DLL_MAIN entry_point = diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index ac460ca..77a17a5 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc @@ -480,7 +480,7 @@ void WizardController::OnEulaAccepted() { #if defined(GOOGLE_CHROME_BUILD) // The crash reporter initialization needs IO to complete. base::ThreadRestrictions::ScopedAllowIO allow_io; - breakpad::InitCrashReporter(); + breakpad::InitCrashReporter(std::string()); #endif } diff --git a/chrome/browser/ui/cocoa/first_run_dialog.mm b/chrome/browser/ui/cocoa/first_run_dialog.mm index 4117e62..9e1fd32 100644 --- a/chrome/browser/ui/cocoa/first_run_dialog.mm +++ b/chrome/browser/ui/cocoa/first_run_dialog.mm @@ -106,8 +106,8 @@ bool ShowFirstRun(Profile* profile) { // on the first run it may not have been enabled due to the missing opt-in // from the user. If the user agreed now, enable breakpad if necessary. if (!breakpad::IsCrashReporterEnabled() && stats_enabled) { - breakpad::InitCrashReporter(); - breakpad::InitCrashProcessInfo(); + breakpad::InitCrashReporter(std::string()); + breakpad::InitCrashProcessInfo(std::string()); } // If selected set as default browser. diff --git a/chrome/browser/ui/gtk/first_run_dialog.cc b/chrome/browser/ui/gtk/first_run_dialog.cc index 25505b5..f002127 100644 --- a/chrome/browser/ui/gtk/first_run_dialog.cc +++ b/chrome/browser/ui/gtk/first_run_dialog.cc @@ -135,7 +135,7 @@ void FirstRunDialog::OnResponseDialog(GtkWidget* widget, int response) { if (report_crashes_ && gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(report_crashes_))) { if (GoogleUpdateSettings::SetCollectStatsConsent(true)) - breakpad::InitCrashReporter(); + breakpad::InitCrashReporter(std::string()); } else { GoogleUpdateSettings::SetCollectStatsConsent(false); } diff --git a/chrome/nacl/nacl_exe_win_64.cc b/chrome/nacl/nacl_exe_win_64.cc index 0b534b4..72be26a 100644 --- a/chrome/nacl/nacl_exe_win_64.cc +++ b/chrome/nacl/nacl_exe_win_64.cc @@ -21,7 +21,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { CommandLine::Init(0, NULL); breakpad::SetBreakpadClient(g_chrome_breakpad_client.Pointer()); - breakpad::InitCrashReporter(); + breakpad::InitCrashReporter(std::string()); return nacl::NaClWin64Main(); } |