From 219d1a6b592cfcb4028b4ff58bb3b4bb4e1684ec Mon Sep 17 00:00:00 2001 From: "robertshield@chromium.org" Date: Wed, 28 Apr 2010 00:45:08 +0000 Subject: Add an ExceptionBarrier around outbound calls to patched methods in IE. In so doing, we have an SEH present in the SEH chain and so the VEH won't erroneously report crashes that occur in other modules when we happen to be on the stack. BUG=42660 TEST=Less false positives in the crash reports. Review URL: http://codereview.chromium.org/1733021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45764 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome_frame/chrome_frame_reporting.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'chrome_frame/chrome_frame_reporting.cc') diff --git a/chrome_frame/chrome_frame_reporting.cc b/chrome_frame/chrome_frame_reporting.cc index 202d43c..556747b2 100644 --- a/chrome_frame/chrome_frame_reporting.cc +++ b/chrome_frame/chrome_frame_reporting.cc @@ -11,6 +11,7 @@ #include "chrome/installer/util/google_update_settings.h" #include "chrome/installer/util/install_util.h" #include "chrome_frame/chrome_frame_reporting.h" +#include "chrome_frame/exception_barrier.h" #include "chrome_frame/utils.h" // Well known SID for the system principal. @@ -45,6 +46,11 @@ google_breakpad::CustomClientInfo* GetCustomInfo(const wchar_t* dll_path) { return &custom_info; } + +void CALLBACK BreakpadHandler(EXCEPTION_POINTERS *ptrs) { + WriteMinidumpForException(ptrs); +} + extern "C" IMAGE_DOS_HEADER __ImageBase; bool InitializeCrashReporting() { @@ -55,6 +61,10 @@ bool InitializeCrashReporting() { if (!always_take_dump && !GoogleUpdateSettings::GetCollectStatsConsent()) return true; + // Set the handler for ExceptionBarrier for this module: + DCHECK(ExceptionBarrier::handler() == NULL); + ExceptionBarrier::set_handler(BreakpadHandler); + // Get the alternate dump directory. We use the temp path. FilePath temp_directory; if (!file_util::GetTempDir(&temp_directory) || temp_directory.empty()) { -- cgit v1.1