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

Side by Side Diff: client/simulate_crash_mac.cc

Issue 1405273002: Mach port scopers should use get() instead of type conversion operators (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: More is_valid() 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_mac.cc ('k') | handler/mac/crash_report_exception_handler.cc » ('j') | 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 for (size_t target_type_index = 0; 214 for (size_t target_type_index = 0;
215 !success && target_type_index < arraysize(kTargetTypes); 215 !success && target_type_index < arraysize(kTargetTypes);
216 ++target_type_index) { 216 ++target_type_index) {
217 ExceptionPorts::ExceptionHandlerVector handlers; 217 ExceptionPorts::ExceptionHandlerVector handlers;
218 ExceptionPorts exception_ports(kTargetTypes[target_type_index], 218 ExceptionPorts exception_ports(kTargetTypes[target_type_index],
219 MACH_PORT_NULL); 219 MACH_PORT_NULL);
220 if (exception_ports.GetExceptionPorts(EXC_MASK_CRASH, &handlers)) { 220 if (exception_ports.GetExceptionPorts(EXC_MASK_CRASH, &handlers)) {
221 DCHECK_LE(handlers.size(), 1u); 221 DCHECK_LE(handlers.size(), 1u);
222 if (handlers.size() == 1) { 222 if (handlers.size() == 1) {
223 DCHECK(handlers[0].mask & EXC_MASK_CRASH); 223 DCHECK(handlers[0].mask & EXC_MASK_CRASH);
224 success = DeliverException(thread, 224 success = DeliverException(thread.get(),
225 mach_task_self(), 225 mach_task_self(),
226 exception, 226 exception,
227 codes, 227 codes,
228 code_count, 228 code_count,
229 cpu_context, 229 cpu_context,
230 handlers[0], 230 handlers[0],
231 false); 231 false);
232 } 232 }
233 } 233 }
234 } 234 }
235 235
236 LOG_IF(WARNING, !success) 236 LOG_IF(WARNING, !success)
237 << "SimulateCrash did not find an appropriate exception handler"; 237 << "SimulateCrash did not find an appropriate exception handler";
238 } 238 }
239 239
240 } // namespace crashpad 240 } // namespace crashpad
OLDNEW
« no previous file with comments | « client/crashpad_client_mac.cc ('k') | handler/mac/crash_report_exception_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698