From 4db3a01e07bc008b8a567c0735dbd813a49a617b Mon Sep 17 00:00:00 2001 From: "jeremy@chromium.org" Date: Wed, 12 Aug 2009 22:40:46 +0000 Subject: Send browser crashes to Apple Crash Reporters. Send crashes to Apple Crash Reporters so we get a nice UI to restart the Browser process if it crashes. BUG=9231 TEST=Induce a browser crash in a Chrome build, Apple Crash reporter UI should appear aftera few seconds. Induce a renderer crash, no UI should be displayed. Review URL: http://codereview.chromium.org/164433 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23237 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/app/breakpad_mac.mm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'chrome/app/breakpad_mac.mm') diff --git a/chrome/app/breakpad_mac.mm b/chrome/app/breakpad_mac.mm index 3307829..3bad98d 100644 --- a/chrome/app/breakpad_mac.mm +++ b/chrome/app/breakpad_mac.mm @@ -42,7 +42,8 @@ void InitCrashReporter() { // Check for Send stats preference. If preference is not specifically turned // on then disable crash reporting. - if (!GoogleUpdateSettings::GetCollectStatsConsent()) { + bool user_consented = GoogleUpdateSettings::GetCollectStatsConsent(); + if (!user_consented) { LOG(WARNING) << "Breakpad disabled"; return; } @@ -68,6 +69,15 @@ void InitCrashReporter() { [breakpad_config setObject:reporter_location forKey:@BREAKPAD_REPORTER_EXE_LOCATION]; + // Pass crash to Crash Reporter if we're a foreground application [the + // browser process]. This is so the user gets notification when Chrome + // crashes and also since we get "restart ui" for free. + BOOL is_background_app = [[info_dictionary objectForKey:@"LSUIElement"] + isEqualToString:@"1"]; + if (!is_background_app) { + [breakpad_config setObject:@"NO" forKey:@BREAKPAD_SEND_AND_EXIT]; + } + // Init breakpad BreakpadRef breakpad = NULL; breakpad = BreakpadCreate(breakpad_config); -- cgit v1.1