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

Unified Diff: third_party/crashpad/crashpad/client/crashpad_client_win.cc

Issue 2702413006: Enable storing last-dispatched exception per-thread. (Closed)
Patch Set: harden exception recording Created 3 years, 10 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
« base/debug/activity_tracker.cc ('K') | « base/debug/activity_tracker_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/crashpad/crashpad/client/crashpad_client_win.cc
diff --git a/third_party/crashpad/crashpad/client/crashpad_client_win.cc b/third_party/crashpad/crashpad/client/crashpad_client_win.cc
index 7a3d0047a98ae4a9fca483c60135d16fbe550475..e6c745d961db92da3cbd58b709e6f6f700868f96 100644
--- a/third_party/crashpad/crashpad/client/crashpad_client_win.cc
+++ b/third_party/crashpad/crashpad/client/crashpad_client_win.cc
@@ -22,6 +22,7 @@
#include <memory>
#include "base/atomicops.h"
+#include "base/debug/activity_tracker.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/scoped_generic.h"
@@ -114,6 +115,16 @@ extern "C" LONG __asan_unhandled_exception_filter(EXCEPTION_POINTERS* info);
#endif
LONG WINAPI UnhandledExceptionHandler(EXCEPTION_POINTERS* exception_pointers) {
+ // Store the event in persistent tracking data.
+ base::debug::GlobalActivityTracker* tracker =
+ base::debug::GlobalActivityTracker::Get();
+ if (tracker) {
+ tracker->SetProcessPhase(
+ base::debug::GlobalActivityTracker::PROCESS_UNHANDLED_EXCEPTION);
+ /*base::debug::ActivityUserData& data =*/tracker->RecordException(nullptr);
+ // TODO(manzagop): Save any other interesting information in process_data.
+ }
+
#if defined(ADDRESS_SANITIZER)
// In ASan builds, delegate to the ASan exception filter.
LONG status = __asan_unhandled_exception_filter(exception_pointers);
« base/debug/activity_tracker.cc ('K') | « base/debug/activity_tracker_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698