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

Side by Side Diff: client/crashpad_client_mac.cc

Issue 1483073004: Replace use of .Pass() with crashpad::move(). (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: pass: . Created 5 years 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/crash_report_database_win.cc ('k') | client/settings.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 14 matching lines...) Expand all
25 #include "base/posix/eintr_wrapper.h" 25 #include "base/posix/eintr_wrapper.h"
26 #include "base/strings/stringprintf.h" 26 #include "base/strings/stringprintf.h"
27 #include "util/mac/mac_util.h" 27 #include "util/mac/mac_util.h"
28 #include "util/mach/child_port_handshake.h" 28 #include "util/mach/child_port_handshake.h"
29 #include "util/mach/exception_ports.h" 29 #include "util/mach/exception_ports.h"
30 #include "util/mach/mach_extensions.h" 30 #include "util/mach/mach_extensions.h"
31 #include "util/mach/mach_message.h" 31 #include "util/mach/mach_message.h"
32 #include "util/mach/notify_server.h" 32 #include "util/mach/notify_server.h"
33 #include "util/misc/clock.h" 33 #include "util/misc/clock.h"
34 #include "util/misc/implicit_cast.h" 34 #include "util/misc/implicit_cast.h"
35 #include "util/stdlib/move.h"
35 #include "util/posix/close_multiple.h" 36 #include "util/posix/close_multiple.h"
36 37
37 namespace crashpad { 38 namespace crashpad {
38 39
39 namespace { 40 namespace {
40 41
41 std::string FormatArgumentString(const std::string& name, 42 std::string FormatArgumentString(const std::string& name,
42 const std::string& value) { 43 const std::string& value) {
43 return base::StringPrintf("--%s=%s", name.c_str(), value.c_str()); 44 return base::StringPrintf("--%s=%s", name.c_str(), value.c_str());
44 } 45 }
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // without the ability to restart. 152 // without the ability to restart.
152 handler_restarter.reset(); 153 handler_restarter.reset();
153 } 154 }
154 } 155 }
155 156
156 if (!CommonStart(handler, 157 if (!CommonStart(handler,
157 database, 158 database,
158 url, 159 url,
159 annotations, 160 annotations,
160 arguments, 161 arguments,
161 receive_right.Pass(), 162 crashpad::move(receive_right),
162 handler_restarter.get(), 163 handler_restarter.get(),
163 false)) { 164 false)) {
164 return base::mac::ScopedMachSendRight(); 165 return base::mac::ScopedMachSendRight();
165 } 166 }
166 167
167 if (handler_restarter && 168 if (handler_restarter &&
168 handler_restarter->StartRestartThread( 169 handler_restarter->StartRestartThread(
169 handler, database, url, annotations, arguments)) { 170 handler, database, url, annotations, arguments)) {
170 // The thread owns the object now. 171 // The thread owns the object now.
171 ignore_result(handler_restarter.release()); 172 ignore_result(handler_restarter.release());
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 HandlerStarter::InitialStart(handler, 532 HandlerStarter::InitialStart(handler,
532 database, 533 database,
533 url, 534 url,
534 annotations, 535 annotations,
535 arguments, 536 arguments,
536 restartable && MacOSXMinorVersion() >= 10)); 537 restartable && MacOSXMinorVersion() >= 10));
537 if (!exception_port.is_valid()) { 538 if (!exception_port.is_valid()) {
538 return false; 539 return false;
539 } 540 }
540 541
541 SetHandlerMachPort(exception_port.Pass()); 542 SetHandlerMachPort(crashpad::move(exception_port));
542 return true; 543 return true;
543 } 544 }
544 545
545 bool CrashpadClient::SetHandlerMachService(const std::string& service_name) { 546 bool CrashpadClient::SetHandlerMachService(const std::string& service_name) {
546 base::mac::ScopedMachSendRight exception_port(BootstrapLookUp(service_name)); 547 base::mac::ScopedMachSendRight exception_port(BootstrapLookUp(service_name));
547 if (!exception_port.is_valid()) { 548 if (!exception_port.is_valid()) {
548 return false; 549 return false;
549 } 550 }
550 551
551 SetHandlerMachPort(exception_port.Pass()); 552 SetHandlerMachPort(crashpad::move(exception_port));
552 return true; 553 return true;
553 } 554 }
554 555
555 void CrashpadClient::SetHandlerMachPort( 556 void CrashpadClient::SetHandlerMachPort(
556 base::mac::ScopedMachSendRight exception_port) { 557 base::mac::ScopedMachSendRight exception_port) {
557 DCHECK(exception_port.is_valid()); 558 DCHECK(exception_port.is_valid());
558 exception_port_ = exception_port.Pass(); 559 exception_port_ = crashpad::move(exception_port);
559 } 560 }
560 561
561 bool CrashpadClient::UseHandler() { 562 bool CrashpadClient::UseHandler() {
562 DCHECK(exception_port_.is_valid()); 563 DCHECK(exception_port_.is_valid());
563 564
564 return SetCrashExceptionPorts(exception_port_.get()); 565 return SetCrashExceptionPorts(exception_port_.get());
565 } 566 }
566 567
567 // static 568 // static
568 void CrashpadClient::UseSystemDefaultHandler() { 569 void CrashpadClient::UseSystemDefaultHandler() {
569 base::mac::ScopedMachSendRight 570 base::mac::ScopedMachSendRight
570 system_crash_reporter_handler(SystemCrashReporterHandler()); 571 system_crash_reporter_handler(SystemCrashReporterHandler());
571 572
572 // Proceed even if SystemCrashReporterHandler() failed, setting MACH_PORT_NULL 573 // Proceed even if SystemCrashReporterHandler() failed, setting MACH_PORT_NULL
573 // to clear the current exception ports. 574 // to clear the current exception ports.
574 if (!SetCrashExceptionPorts(system_crash_reporter_handler.get())) { 575 if (!SetCrashExceptionPorts(system_crash_reporter_handler.get())) {
575 SetCrashExceptionPorts(MACH_PORT_NULL); 576 SetCrashExceptionPorts(MACH_PORT_NULL);
576 } 577 }
577 } 578 }
578 579
579 } // namespace crashpad 580 } // namespace crashpad
OLDNEW
« no previous file with comments | « client/crash_report_database_win.cc ('k') | client/settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698