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

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: 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 CrashpadInfo::TriState* enable_crashpad_handler,
84 CrashpadInfo::TriState* enable_native_crash_reporter_forwarding) {
85 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
86
87 CrashpadInfo::TriState local_enable_crashpad_handler = CrashpadInfo::kDefault;
88 CrashpadInfo::TriState local_enable_native_crash_reporter_forwarding =
89 CrashpadInfo::kDefault;
90
91 for (internal::ModuleSnapshotMac* module : modules_) {
92 CrashpadInfo::TriState module_enable_crashpad_handler;
93 CrashpadInfo::TriState module_enable_native_crash_reporter_forwarding;
94 module->GetCrashpadOptions(
95 &module_enable_crashpad_handler,
96 &module_enable_native_crash_reporter_forwarding);
97
98 if (local_enable_crashpad_handler == CrashpadInfo::kDefault) {
99 local_enable_crashpad_handler = module_enable_crashpad_handler;
100 }
101 if (local_enable_native_crash_reporter_forwarding ==
102 CrashpadInfo::kDefault) {
103 local_enable_native_crash_reporter_forwarding =
104 module_enable_native_crash_reporter_forwarding;
105 }
106
107 if (local_enable_crashpad_handler != CrashpadInfo::kDefault &&
108 local_enable_native_crash_reporter_forwarding !=
109 CrashpadInfo::kDefault) {
110 break;
111 }
112 }
113
114 *enable_crashpad_handler = local_enable_crashpad_handler;
115 *enable_native_crash_reporter_forwarding =
116 local_enable_native_crash_reporter_forwarding;
117 }
118
82 pid_t ProcessSnapshotMac::ProcessID() const { 119 pid_t ProcessSnapshotMac::ProcessID() const {
83 INITIALIZATION_STATE_DCHECK_VALID(initialized_); 120 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
84 return process_reader_.ProcessID(); 121 return process_reader_.ProcessID();
85 } 122 }
86 123
87 pid_t ProcessSnapshotMac::ParentProcessID() const { 124 pid_t ProcessSnapshotMac::ParentProcessID() const {
88 INITIALIZATION_STATE_DCHECK_VALID(initialized_); 125 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
89 return process_reader_.ProcessID(); 126 return process_reader_.ProcessID();
90 } 127 }
91 128
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 for (const ProcessReader::Module& process_reader_module : 194 for (const ProcessReader::Module& process_reader_module :
158 process_reader_modules) { 195 process_reader_modules) {
159 auto module = make_scoped_ptr(new internal::ModuleSnapshotMac()); 196 auto module = make_scoped_ptr(new internal::ModuleSnapshotMac());
160 if (module->Initialize(&process_reader_, process_reader_module)) { 197 if (module->Initialize(&process_reader_, process_reader_module)) {
161 modules_.push_back(module.release()); 198 modules_.push_back(module.release());
162 } 199 }
163 } 200 }
164 } 201 }
165 202
166 } // namespace crashpad 203 } // namespace crashpad
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698