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

Unified Diff: snapshot/mac/module_snapshot_mac.cc

Issue 997713002: Allow exception forwarding to the system’s native crash reporter to be disabled (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 9 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: snapshot/mac/module_snapshot_mac.cc
diff --git a/snapshot/mac/module_snapshot_mac.cc b/snapshot/mac/module_snapshot_mac.cc
index ddbb6a00b9cb88fca15f6048b88f0b03d5317d43..da4ad34afdf03c99fb2a3805e281e23233178002 100644
--- a/snapshot/mac/module_snapshot_mac.cc
+++ b/snapshot/mac/module_snapshot_mac.cc
@@ -55,6 +55,37 @@ bool ModuleSnapshotMac::Initialize(
return true;
}
+void ModuleSnapshotMac::GetCrashpadOptions(
+ CrashpadInfo::TriState* enable_crashpad_handler,
+ CrashpadInfo::TriState* enable_native_crash_reporter_forwarding) {
+ INITIALIZATION_STATE_DCHECK_VALID(initialized_);
+ MachOImageAnnotationsReader annotations_reader(
+ process_reader_, mach_o_image_reader_, name_);
+
+ process_types::CrashpadInfo crashpad_info;
+ if (!annotations_reader.GetCrashpadInfo(&crashpad_info)) {
+ *enable_crashpad_handler = CrashpadInfo::kDefault;
+ *enable_native_crash_reporter_forwarding = CrashpadInfo::kDefault;
+ return;
+ }
+
+ int value = crashpad_info.options & 0x3;
Robert Sesek 2015/03/10 23:03:04 Yeah, this should be an enum with constants.
+ if (value == 3) {
+ LOG(WARNING) << "unknown value 3 for enable_crashpad_handler";
+ value = CrashpadInfo::kDefault;
+ }
+ *enable_crashpad_handler = static_cast<CrashpadInfo::TriState>(value);
+
+ value = (crashpad_info.options >> 2) & 0x3;
+ if (value == 3) {
+ LOG(WARNING)
+ << "unknown value 3 for enable_native_crash_reporter_forwarding";
+ value = CrashpadInfo::kDefault;
+ }
+ *enable_native_crash_reporter_forwarding =
+ static_cast<CrashpadInfo::TriState>(value);
+}
+
std::string ModuleSnapshotMac::Name() const {
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
return name_;

Powered by Google App Engine
This is Rietveld 408576698