summaryrefslogtreecommitdiffstats
path: root/chrome/app
diff options
context:
space:
mode:
authorsanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-15 00:13:25 +0000
committersanjeevr@chromium.org <sanjeevr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-15 00:13:25 +0000
commit5832ff87058de4a6eec25fd2abb183134e834124 (patch)
tree3966720a33620d9346b828145ddf4447f8e8c3f8 /chrome/app
parentff8b37511ce0a3a07e416ab5ee8842fdcaa04dfe (diff)
downloadchromium_src-5832ff87058de4a6eec25fd2abb183134e834124.zip
chromium_src-5832ff87058de4a6eec25fd2abb183134e834124.tar.gz
chromium_src-5832ff87058de4a6eec25fd2abb183134e834124.tar.bz2
Added code to restart the service process in the event of a crash.
BUG=None. TEST=A crash in the cloud print proxy should prompt the user for a restart. Review URL: http://codereview.chromium.org/6474030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74886 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app')
-rw-r--r--chrome/app/breakpad_win.cc33
-rw-r--r--chrome/app/breakpad_win.h4
-rw-r--r--chrome/app/generated_resources.grd5
3 files changed, 29 insertions, 13 deletions
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc
index fc85b26..b860bef 100644
--- a/chrome/app/breakpad_win.cc
+++ b/chrome/app/breakpad_win.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -276,6 +276,14 @@ long WINAPI ChromeExceptionFilter(EXCEPTION_POINTERS* info) {
return EXCEPTION_EXECUTE_HANDLER;
}
+// Exception filter for the service process used when breakpad is not enabled.
+// We just display the "Do you want to restart" message and then die
+// (without calling the previous filter).
+long WINAPI ServiceExceptionFilter(EXCEPTION_POINTERS* info) {
+ DumpDoneCallback(NULL, NULL, NULL, info, NULL, false);
+ return EXCEPTION_EXECUTE_HANDLER;
+}
+
extern "C" void __declspec(dllexport) __cdecl SetActiveURL(
const wchar_t* url_cstring) {
DCHECK(url_cstring);
@@ -465,10 +473,15 @@ static DWORD __stdcall InitCrashReporterThread(void* param) {
info->custom_info = GetCustomInfo(info->dll_path, info->process_type);
google_breakpad::ExceptionHandler::MinidumpCallback callback = NULL;
+ LPTOP_LEVEL_EXCEPTION_FILTER default_filter = NULL;
+ // We install the post-dump callback only for the browser and service
+ // processes. It spawns a new browser/service process.
if (info->process_type == L"browser") {
- // We install the post-dump callback only for the browser process. It
- // spawns a new browser process.
callback = &DumpDoneCallback;
+ default_filter = &ChromeExceptionFilter;
+ } else if (info->process_type == L"service") {
+ callback = &DumpDoneCallback;
+ default_filter = &ServiceExceptionFilter;
}
// Check whether configuration management controls crash reporting.
@@ -498,9 +511,9 @@ static DWORD __stdcall InitCrashReporterThread(void* param) {
if (!crash_reporting_enabled) {
// Configuration managed or the user did not allow Google Update to send
// crashes, we need to use our default crash handler instead, but only
- // for the browser process.
- if (callback)
- InitDefaultCrashCallback();
+ // for the browser/service processes.
+ if (default_filter)
+ InitDefaultCrashCallback(default_filter);
return 0;
}
@@ -510,8 +523,8 @@ static DWORD __stdcall InitCrashReporterThread(void* param) {
std::wstring user_sid;
if (is_per_user_install) {
if (!base::win::GetUserSidString(&user_sid)) {
- if (callback)
- InitDefaultCrashCallback();
+ if (default_filter)
+ InitDefaultCrashCallback(default_filter);
return -1;
}
} else {
@@ -559,8 +572,8 @@ static DWORD __stdcall InitCrashReporterThread(void* param) {
return 0;
}
-void InitDefaultCrashCallback() {
- previous_filter = SetUnhandledExceptionFilter(ChromeExceptionFilter);
+void InitDefaultCrashCallback(LPTOP_LEVEL_EXCEPTION_FILTER filter) {
+ previous_filter = SetUnhandledExceptionFilter(filter);
}
void InitCrashReporterWithDllPath(const std::wstring& dll_path) {
diff --git a/chrome/app/breakpad_win.h b/chrome/app/breakpad_win.h
index 9b223730..f528ecc 100644
--- a/chrome/app/breakpad_win.h
+++ b/chrome/app/breakpad_win.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -18,7 +18,7 @@ void InitCrashReporterWithDllPath(const std::wstring& dll_path);
// Intercepts a crash but does not process it, just ask if we want to restart
// the browser or not.
-void InitDefaultCrashCallback();
+void InitDefaultCrashCallback(LPTOP_LEVEL_EXCEPTION_FILTER filter);
// If chrome has been restarted because it crashed, this function will display
// a dialog asking for permission to continue execution or to exit now.
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 1e2cd4c..7ca6f92 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -5413,7 +5413,10 @@ Keep your key file in a safe place. You will need it to create new versions of y
</message>
<message name="IDS_CLOUD_PRINT_ENUM_FAILED" desc="Status message to be sent to the Cloud Print server when enumerating printers failed.">
There was a problem listing printers. Some of your printers may not have registered successfully with <ph name="CLOUD_PRINT_NAME">Google Cloud Print</ph>.
- </message>
+ </message>
+ <message name="IDS_SERVICE_CRASH_RECOVERY_CONTENT" desc="Text content telling the user the service process has crashed.">
+ The <ph name="CLOUD_PRINT_NAME">Google Cloud Print</ph> connector process has crashed. Restart?
+ </message>
<!-- Print Preview -->
<message name="IDS_PRINT_PREVIEW_TITLE" desc="Title for print preview page ">