Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Unified Diff: chrome/browser/browser_main_win.cc

Issue 6697004: Add an exception wrapper to the WindowProc functions so... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/browser_main_win.cc
===================================================================
--- chrome/browser/browser_main_win.cc (revision 78053)
+++ chrome/browser/browser_main_win.cc (working copy)
@@ -19,10 +19,12 @@
#include "base/scoped_ptr.h"
#include "base/utf_string_conversions.h"
#include "base/win/windows_version.h"
+#include "base/win/wrapped_window_proc.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/metrics/metrics_service.h"
#include "chrome/browser/ui/views/uninstall_view.h"
+#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/env_vars.h"
#include "chrome/common/result_codes.h"
@@ -42,9 +44,22 @@
#include "views/window/window.h"
namespace {
+
typedef HRESULT (STDAPICALLTYPE* RegisterApplicationRestartProc)(
const wchar_t* command_line,
DWORD flags);
+
+void InitializeWindowProcExceptions() {
+ // Get the breakpad pointer from chrome.exe
+ base::win::WinProcExceptionFilter exception_filter =
+ reinterpret_cast<base::win::WinProcExceptionFilter>(
+ ::GetProcAddress(::GetModuleHandle(
+ chrome::kBrowserProcessExecutableName),
+ "CrashForException"));
+ exception_filter = base::win::SetWinProcExceptionFilter(exception_filter);
+ DCHECK(!exception_filter);
+}
+
} // namespace
void DidEndMainMessageLoop() {
@@ -264,6 +279,9 @@
if (!parameters().ui_task) {
// Override the configured locale with the user's preferred UI language.
l10n_util::OverrideLocaleWithUILanguageList();
+
+ // Make sure that we know how to handle exceptions from the message loop.
+ InitializeWindowProcExceptions();
}
}

Powered by Google App Engine
This is Rietveld 408576698