OLD | NEW |
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 Loading... |
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 |
OLD | NEW |