diff options
author | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-31 23:08:00 +0000 |
---|---|---|
committer | jeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-31 23:08:00 +0000 |
commit | 385f4973b13bcbd2deecfae311abfe10eaf3aee9 (patch) | |
tree | 0dd19b9e26444d691daef723df84ba3c2a44e491 /chrome/app/chrome_dll_main.cc | |
parent | da40d4ea45f0214f29480a37bf665192d694b957 (diff) | |
download | chromium_src-385f4973b13bcbd2deecfae311abfe10eaf3aee9.zip chromium_src-385f4973b13bcbd2deecfae311abfe10eaf3aee9.tar.gz chromium_src-385f4973b13bcbd2deecfae311abfe10eaf3aee9.tar.bz2 |
Change when we enable Apple's Crash reporter.
Enable Apple Crash Reporter for Browser process in Non-Debug builds.
* Introduce mac_util::IsBackgroundProcess().
* Invert logic around Breakpad Enabling/Disabling to make it clearer.
* Honor the kDisableBreakpad switch.
Our new policy:
* Breakpad is enabled/disabled based on the user stats reporting opt-in flag - this hasn't changed.
* Always disable Apple Crash in background processes (plug-in, renderer, etc).
* If Breakpad is enabled browser crashes will be passed to Crash Reporter.
* If Breakpad is NOT enabled browser [or any other foreground app] crashes will be passed to Crash Reporter in Release builds.
Effectively this means that we now enable Crash Reporter for the browser process in Chromium release builds so these will no longer crash silently with no trace.
Review URL: http://codereview.chromium.org/180048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24959 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/chrome_dll_main.cc')
-rw-r--r-- | chrome/app/chrome_dll_main.cc | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/chrome/app/chrome_dll_main.cc b/chrome/app/chrome_dll_main.cc index 7562c1f..5f7e37f 100644 --- a/chrome/app/chrome_dll_main.cc +++ b/chrome/app/chrome_dll_main.cc @@ -433,12 +433,34 @@ int ChromeMain(int argc, const char** argv) { // dylib is even loaded, to catch potential early crashes. InitCrashReporter(); - // If Breakpad is not present, turn off OS crash dumps to avoid having - // to wait eons for Apple's Crash Reporter to generate dumps for builds - // where debugging symbols are present. - if (IsCrashReporterDisabled()) - DebugUtil::DisableOSCrashDumps(); - else +#if defined(NDEBUG) + bool is_debug_build = false; +#else + bool is_debug_build = true; +#endif + + // Details on when we enable Apple's Crash reporter. + // + // Motivation: + // In debug mode it takes Apple's crash reporter eons to generate a crash + // dump. + // + // What we do: + // * We only pass crashes for foreground processes to Apple's Crash reporter. + // At the time of this writing, that means just the Browser process. + // * If Breakpad is enabled, it will pass browser crashes to Crash Reporter + // itself. + // * If Breakpad is disabled, we only turn on Crash Reporter for the + // Browser process in release mode. + if (!parsed_command_line.HasSwitch(switches::kDisableBreakpad)) { + bool disable_apple_crash_reporter = is_debug_build + || mac_util::IsBackgroundOnlyProcess(); + if (!IsCrashReporterEnabled() && disable_apple_crash_reporter) { + DebugUtil::DisableOSCrashDumps(); + } + } + + if (IsCrashReporterEnabled()) InitCrashProcessInfo(); #endif // OS_MACOSX |