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
diff --git a/chrome_frame/chrome_frame_reporting.cc b/chrome_frame/chrome_frame_reporting.cc
index 202d43ca..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 @@
return &custom_info;
}
+
+void CALLBACK BreakpadHandler(EXCEPTION_POINTERS *ptrs) {
+ WriteMinidumpForException(ptrs);
+}
+
extern "C" IMAGE_DOS_HEADER __ImageBase;
bool InitializeCrashReporting() {
@@ -55,6 +61,10 @@
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()) {