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

Side by Side Diff: client/crashpad_client_mac.cc

Issue 1386943002: mac: Make UseSystemDefaultHandler() clear handlers on failure (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « client/crashpad_client.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 return exception_port_ ? true : false; 214 return exception_port_ ? true : false;
215 } 215 }
216 216
217 bool CrashpadClient::UseHandler() { 217 bool CrashpadClient::UseHandler() {
218 DCHECK_NE(exception_port_, kMachPortNull); 218 DCHECK_NE(exception_port_, kMachPortNull);
219 219
220 return SetCrashExceptionPorts(exception_port_); 220 return SetCrashExceptionPorts(exception_port_);
221 } 221 }
222 222
223 // static 223 // static
224 bool CrashpadClient::UseSystemDefaultHandler() { 224 void CrashpadClient::UseSystemDefaultHandler() {
225 base::mac::ScopedMachSendRight 225 base::mac::ScopedMachSendRight
226 system_crash_reporter_handler(SystemCrashReporterHandler()); 226 system_crash_reporter_handler(SystemCrashReporterHandler());
227 227
228 // Proceed even if SystemCrashReporterHandler() failed, setting MACH_PORT_NULL 228 // Proceed even if SystemCrashReporterHandler() failed, setting MACH_PORT_NULL
229 // to clear the current exception ports. 229 // to clear the current exception ports.
230 return SetCrashExceptionPorts(system_crash_reporter_handler); 230 if (!SetCrashExceptionPorts(system_crash_reporter_handler)) {
231 SetCrashExceptionPorts(MACH_PORT_NULL);
232 }
231 } 233 }
232 234
233 } // namespace crashpad 235 } // namespace crashpad
OLDNEW
« no previous file with comments | « client/crashpad_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698