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

Side by Side Diff: tools/mac/catch_exception_tool.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 | « test/mac/mach_multiprocess.cc ('k') | tools/mac/exception_port_tool.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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 mach_msg_timeout_t timeout_ms; 294 mach_msg_timeout_t timeout_ms;
295 if (!options.has_timeout) { 295 if (!options.has_timeout) {
296 timeout_ms = kMachMessageTimeoutWaitIndefinitely; 296 timeout_ms = kMachMessageTimeoutWaitIndefinitely;
297 } else if (options.timeout_secs == 0) { 297 } else if (options.timeout_secs == 0) {
298 timeout_ms = kMachMessageTimeoutNonblocking; 298 timeout_ms = kMachMessageTimeoutNonblocking;
299 } else { 299 } else {
300 timeout_ms = options.timeout_secs * 1000; 300 timeout_ms = options.timeout_secs * 1000;
301 } 301 }
302 302
303 mach_msg_return_t mr = MachMessageServer::Run(&universal_mach_exc_server, 303 mach_msg_return_t mr = MachMessageServer::Run(&universal_mach_exc_server,
304 service_port, 304 service_port.get(),
305 MACH_MSG_OPTION_NONE, 305 MACH_MSG_OPTION_NONE,
306 options.persistent, 306 options.persistent,
307 receive_large, 307 receive_large,
308 timeout_ms); 308 timeout_ms);
309 if (mr == MACH_RCV_TIMED_OUT && options.has_timeout && options.persistent && 309 if (mr == MACH_RCV_TIMED_OUT && options.has_timeout && options.persistent &&
310 exceptions_handled) { 310 exceptions_handled) {
311 // This is not an error: when exiting on timeout during persistent 311 // This is not an error: when exiting on timeout during persistent
312 // processing and at least one exception was handled, it’s considered a 312 // processing and at least one exception was handled, it’s considered a
313 // success. 313 // success.
314 } else if (mr != MACH_MSG_SUCCESS) { 314 } else if (mr != MACH_MSG_SUCCESS) {
315 MACH_LOG(ERROR, mr) << "MachMessageServer::Run"; 315 MACH_LOG(ERROR, mr) << "MachMessageServer::Run";
316 return EXIT_FAILURE; 316 return EXIT_FAILURE;
317 } 317 }
318 318
319 return EXIT_SUCCESS; 319 return EXIT_SUCCESS;
320 } 320 }
321 321
322 } // namespace 322 } // namespace
323 } // namespace crashpad 323 } // namespace crashpad
324 324
325 int main(int argc, char* argv[]) { 325 int main(int argc, char* argv[]) {
326 return crashpad::CatchExceptionToolMain(argc, argv); 326 return crashpad::CatchExceptionToolMain(argc, argv);
327 } 327 }
OLDNEW
« no previous file with comments | « test/mac/mach_multiprocess.cc ('k') | tools/mac/exception_port_tool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698