diff options
-rw-r--r-- | chrome/app/breakpad.cc | 6 | ||||
-rw-r--r-- | chrome/app/chrome_exe_main.cc | 10 |
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")); |