summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-22 22:16:44 +0000
committernsylvain@chromium.org <nsylvain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-22 22:16:44 +0000
commitcb910e336663dd63a35f2721c50419b0fdc1500e (patch)
treec68bdb8ba9ffe562777cc21065cb1b9419b28d9c
parenta60637ef856d2befff63e38fe46a48feef7e27dc (diff)
downloadchromium_src-cb910e336663dd63a35f2721c50419b0fdc1500e.zip
chromium_src-cb910e336663dd63a35f2721c50419b0fdc1500e.tar.gz
chromium_src-cb910e336663dd63a35f2721c50419b0fdc1500e.tar.bz2
Set the default flag to know if we should restart the process
on crash to "False", so if we fail to display the message box, we wont restart it. BUG:7900 Review URL: http://codereview.chromium.org/27023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10166 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/breakpad.cc6
-rw-r--r--chrome/app/chrome_exe_main.cc10
2 files changed, 13 insertions, 3 deletions
diff --git a/chrome/app/breakpad.cc b/chrome/app/breakpad.cc
index 70aaf97..540127a 100644
--- a/chrome/app/breakpad.cc
+++ b/chrome/app/breakpad.cc
@@ -129,9 +129,11 @@ long WINAPI ChromeExceptionFilter(EXCEPTION_POINTERS* info) {
bool ShowRestartDialogIfCrashed(bool* exit_now) {
if (!::GetEnvironmentVariableW(env_vars::kShowRestart, NULL, 0))
return false;
+
DWORD len = ::GetEnvironmentVariableW(env_vars::kRestartInfo, NULL, 0);
if (!len)
- return false;
+ return true;
+
wchar_t* restart_data = new wchar_t[len + 1];
::GetEnvironmentVariableW(env_vars::kRestartInfo, restart_data, len);
restart_data[len] = 0;
@@ -141,7 +143,7 @@ bool ShowRestartDialogIfCrashed(bool* exit_now) {
SplitString(restart_data, L'|', &dlg_strings);
delete[] restart_data;
if (dlg_strings.size() < 3)
- return false;
+ return true;
// If the UI layout is right-to-left, we need to pass the appropriate MB_XXX
// flags so that an RTL message box is displayed.
diff --git a/chrome/app/chrome_exe_main.cc b/chrome/app/chrome_exe_main.cc
index 6399198..3065597 100644
--- a/chrome/app/chrome_exe_main.cc
+++ b/chrome/app/chrome_exe_main.cc
@@ -55,7 +55,7 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev_instance,
// Initialize the crash reporter.
InitCrashReporter(client.GetDLLPath());
- bool exit_now = false;
+ bool exit_now = true;
if (ShowRestartDialogIfCrashed(&exit_now)) {
// We have restarted because of a previous crash. The user might
// decide that he does not want to continue.
@@ -88,6 +88,14 @@ int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE prev_instance,
// Initialize the crash reporter.
InitCrashReporter(client_util::GetDLLPath(dll_name, dll_path));
+ bool exit_now = true;
+ if (ShowRestartDialogIfCrashed(&exit_now)) {
+ // We have restarted because of a previous crash. The user might
+ // decide that he does not want to continue.
+ if (exit_now)
+ return ResultCodes::NORMAL_EXIT;
+ }
+
if (NULL != dll_handle) {
client_util::DLL_MAIN entry = reinterpret_cast<client_util::DLL_MAIN>(
::GetProcAddress(dll_handle, "ChromeMain"));