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

Unified Diff: chrome_frame/crash_reporting/vectored_handler-impl.h

Issue 1748016: Avoid reporting crashes for exceptions that hit our SEH from calls to the ori... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 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_frame/crash_reporting/vectored_handler-impl.h
===================================================================
--- chrome_frame/crash_reporting/vectored_handler-impl.h (revision 45197)
+++ chrome_frame/crash_reporting/vectored_handler-impl.h (working copy)
@@ -4,6 +4,8 @@
#ifndef CHROME_FRAME_CRASH_REPORTING_VECTORED_HANDLER_IMPL_H_
#define CHROME_FRAME_CRASH_REPORTING_VECTORED_HANDLER_IMPL_H_
+
+#include "base/logging.h"
#include "chrome_frame/crash_reporting/vectored_handler.h"
#include "chrome_frame/crash_reporting/nt_loader.h"
@@ -262,4 +264,44 @@
{ "kernel32.dll", "IsBadStringPtrW", 0, 100, NULL },
};
+// Use Win32 API; checks for single (current) module. Will call a specified
+// CrashHandlerTraits::DumpHandler when taking a dump.
+class CrashHandlerTraits : public Win32VEHTraits,
+ public ModuleOfInterestWithExcludedRegion {
+ public:
+
+ typedef bool (*DumpHandler)(EXCEPTION_POINTERS* p);
+
+ CrashHandlerTraits() : dump_handler_(NULL) {}
+
+ // Note that breakpad_lock must be held when this is called.
+ void Init(const void* veh_segment_start, const void* veh_segment_end,
+ DumpHandler dump_handler) {
+ DCHECK(dump_handler);
+ dump_handler_ = dump_handler;
+ Win32VEHTraits::InitializeIgnoredBlocks();
+ ModuleOfInterestWithExcludedRegion::SetCurrentModule();
+ // Pointers to static (non-extern) functions take the address of the
+ // function's first byte, as opposed to an entry in the compiler generated
+ // JMP table. In release builds /OPT:REF wipes away the JMP table, but debug
+ // builds are not so lucky.
+ ModuleOfInterestWithExcludedRegion::SetExcludedRegion(veh_segment_start,
+ veh_segment_end);
+ }
+
+ void Shutdown() {
+ }
+
+ inline bool WriteDump(EXCEPTION_POINTERS* p) {
+ if (dump_handler_) {
+ return dump_handler_(p);
+ } else {
+ return false;
+ }
+ }
+
+ private:
+ DumpHandler dump_handler_;
+};
+
#endif // CHROME_FRAME_CRASH_REPORTING_VECTORED_HANDLER_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698