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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 flavor, 72 flavor,
73 state, 73 state,
74 state_count)) { 74 state_count)) {
75 exception_.reset(); 75 exception_.reset();
76 return false; 76 return false;
77 } 77 }
78 78
79 return true; 79 return true;
80 } 80 }
81 81
82 void ProcessSnapshotMac::GetCrashpadOptions(
83 CrashpadInfoClientOptions* options) {
84 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
85
86 CrashpadInfoClientOptions local_options;
87
88 for (internal::ModuleSnapshotMac* module : modules_) {
89 CrashpadInfoClientOptions module_options;
90 module->GetCrashpadOptions(&module_options);
91
92 if (local_options.crashpad_handler_behavior ==
93 CrashpadInfoClientOptions::TriState::kDefault) {
94 local_options.crashpad_handler_behavior =
95 module_options.crashpad_handler_behavior;
96 }
97 if (local_options.system_crash_reporter_forwarding ==
98 CrashpadInfoClientOptions::TriState::kDefault) {
99 local_options.system_crash_reporter_forwarding =
100 module_options.system_crash_reporter_forwarding;
101 }
102
103 // If non-default values have been found for all options, the loop can end
104 // early.
105 if (local_options.crashpad_handler_behavior !=
106 CrashpadInfoClientOptions::TriState::kDefault &&
107 local_options.system_crash_reporter_forwarding !=
108 CrashpadInfoClientOptions::TriState::kDefault) {
109 break;
110 }
111 }
112
113 *options = local_options;
114 }
115
82 pid_t ProcessSnapshotMac::ProcessID() const { 116 pid_t ProcessSnapshotMac::ProcessID() const {
83 INITIALIZATION_STATE_DCHECK_VALID(initialized_); 117 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
84 return process_reader_.ProcessID(); 118 return process_reader_.ProcessID();
85 } 119 }
86 120
87 pid_t ProcessSnapshotMac::ParentProcessID() const { 121 pid_t ProcessSnapshotMac::ParentProcessID() const {
88 INITIALIZATION_STATE_DCHECK_VALID(initialized_); 122 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
89 return process_reader_.ProcessID(); 123 return process_reader_.ProcessID();
90 } 124 }
91 125
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 for (const ProcessReader::Module& process_reader_module : 191 for (const ProcessReader::Module& process_reader_module :
158 process_reader_modules) { 192 process_reader_modules) {
159 auto module = make_scoped_ptr(new internal::ModuleSnapshotMac()); 193 auto module = make_scoped_ptr(new internal::ModuleSnapshotMac());
160 if (module->Initialize(&process_reader_, process_reader_module)) { 194 if (module->Initialize(&process_reader_, process_reader_module)) {
161 modules_.push_back(module.release()); 195 modules_.push_back(module.release());
162 } 196 }
163 } 197 }
164 } 198 }
165 199
166 } // namespace crashpad 200 } // namespace crashpad
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698