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

Unified Diff: snapshot/mac/process_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: Address review feedback 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/process_snapshot_mac.cc
diff --git a/snapshot/mac/process_snapshot_mac.cc b/snapshot/mac/process_snapshot_mac.cc
index bb11526706551b0fc7b41a670b5cd04899bd2cb2..734b250dddcab58ce18e170c9734892067082e0b 100644
--- a/snapshot/mac/process_snapshot_mac.cc
+++ b/snapshot/mac/process_snapshot_mac.cc
@@ -79,6 +79,40 @@ bool ProcessSnapshotMac::InitializeException(
return true;
}
+void ProcessSnapshotMac::GetCrashpadOptions(
+ CrashpadInfoClientOptions* options) {
+ INITIALIZATION_STATE_DCHECK_VALID(initialized_);
+
+ CrashpadInfoClientOptions local_options;
+
+ for (internal::ModuleSnapshotMac* module : modules_) {
+ CrashpadInfoClientOptions module_options;
+ module->GetCrashpadOptions(&module_options);
+
+ if (local_options.crashpad_handler_behavior ==
+ CrashpadInfoClientOptions::TriState::kDefault) {
+ local_options.crashpad_handler_behavior =
+ module_options.crashpad_handler_behavior;
+ }
+ if (local_options.system_crash_reporter_forwarding ==
+ CrashpadInfoClientOptions::TriState::kDefault) {
+ local_options.system_crash_reporter_forwarding =
+ module_options.system_crash_reporter_forwarding;
+ }
+
+ // If non-default values have been found for all options, the loop can end
+ // early.
+ if (local_options.crashpad_handler_behavior !=
+ CrashpadInfoClientOptions::TriState::kDefault &&
+ local_options.system_crash_reporter_forwarding !=
+ CrashpadInfoClientOptions::TriState::kDefault) {
+ break;
+ }
+ }
+
+ *options = local_options;
+}
+
pid_t ProcessSnapshotMac::ProcessID() const {
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
return process_reader_.ProcessID();

Powered by Google App Engine
This is Rietveld 408576698