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

Unified Diff: third_party/crashpad/crashpad/handler/win/crash_report_exception_handler.cc

Issue 2350943003: Update Crashpad to 0aeca5f12374fdbf3d4f6c656abf950ba2a96f1c (Closed)
Patch Set: . Created 4 years, 3 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: third_party/crashpad/crashpad/handler/win/crash_report_exception_handler.cc
diff --git a/third_party/crashpad/crashpad/handler/win/crash_report_exception_handler.cc b/third_party/crashpad/crashpad/handler/win/crash_report_exception_handler.cc
index b9c6d1118d13c532e0405870b1129c69ea80cf7b..a58c5ab9fc525b296775efc00a0c1dc4123a3575 100644
--- a/third_party/crashpad/crashpad/handler/win/crash_report_exception_handler.cc
+++ b/third_party/crashpad/crashpad/handler/win/crash_report_exception_handler.cc
@@ -14,12 +14,15 @@
#include "handler/win/crash_report_exception_handler.h"
+#include <type_traits>
+
#include "client/crash_report_database.h"
#include "client/settings.h"
#include "handler/crash_report_upload_thread.h"
#include "minidump/minidump_file_writer.h"
#include "snapshot/win/process_snapshot_win.h"
#include "util/file/file_writer.h"
+#include "util/misc/metrics.h"
#include "util/win/registration_protocol_win.h"
#include "util/win/scoped_process_suspend.h"
@@ -46,6 +49,8 @@ unsigned int CrashReportExceptionHandler::ExceptionHandlerServerException(
WinVMAddress debug_critical_section_address) {
const unsigned int kFailedTerminationCode = 0xffff7002;
+ Metrics::ExceptionEncountered();
+
ScopedProcessSuspend suspend(process);
ProcessSnapshotWin process_snapshot;
@@ -54,6 +59,7 @@ unsigned int CrashReportExceptionHandler::ExceptionHandlerServerException(
exception_information_address,
debug_critical_section_address)) {
LOG(WARNING) << "ProcessSnapshotWin::Initialize failed";
+ Metrics::ExceptionCaptureResult(Metrics::CaptureResult::kSnapshotFailed);
return kFailedTerminationCode;
}
@@ -61,6 +67,12 @@ unsigned int CrashReportExceptionHandler::ExceptionHandlerServerException(
// can terminate the process with the correct exit code.
const unsigned int termination_code =
process_snapshot.Exception()->Exception();
+ static_assert(
+ std::is_same<std::remove_const<decltype(termination_code)>::type,
+ decltype(process_snapshot.Exception()->Exception())>::value,
+ "expected ExceptionCode() and process termination code to match");
+
+ Metrics::ExceptionCode(termination_code);
CrashpadInfoClientOptions client_options;
process_snapshot.GetCrashpadOptions(&client_options);
@@ -82,6 +94,8 @@ unsigned int CrashReportExceptionHandler::ExceptionHandlerServerException(
database_->PrepareNewCrashReport(&new_report);
if (database_status != CrashReportDatabase::kNoError) {
LOG(ERROR) << "PrepareNewCrashReport failed";
+ Metrics::ExceptionCaptureResult(
+ Metrics::CaptureResult::kPrepareNewCrashReportFailed);
return termination_code;
}
@@ -96,6 +110,8 @@ unsigned int CrashReportExceptionHandler::ExceptionHandlerServerException(
minidump.InitializeFromSnapshot(&process_snapshot);
if (!minidump.WriteEverything(&file_writer)) {
LOG(ERROR) << "WriteEverything failed";
+ Metrics::ExceptionCaptureResult(
+ Metrics::CaptureResult::kMinidumpWriteFailed);
return termination_code;
}
@@ -105,12 +121,15 @@ unsigned int CrashReportExceptionHandler::ExceptionHandlerServerException(
database_status = database_->FinishedWritingCrashReport(new_report, &uuid);
if (database_status != CrashReportDatabase::kNoError) {
LOG(ERROR) << "FinishedWritingCrashReport failed";
+ Metrics::ExceptionCaptureResult(
+ Metrics::CaptureResult::kFinishedWritingCrashReportFailed);
return termination_code;
}
upload_thread_->ReportPending();
}
+ Metrics::ExceptionCaptureResult(Metrics::CaptureResult::kSuccess);
return termination_code;
}

Powered by Google App Engine
This is Rietveld 408576698