Index: client/crashpad_client_mac.cc |
diff --git a/client/crashpad_client_mac.cc b/client/crashpad_client_mac.cc |
index bb6a7805f1ecf0a764bc569b5c0b217c78b532b3..d5e3545b2094a312cb185bcfab081b6f402ca515 100644 |
--- a/client/crashpad_client_mac.cc |
+++ b/client/crashpad_client_mac.cc |
@@ -517,20 +517,37 @@ bool CrashpadClient::StartHandler( |
// The “restartable” behavior can only be selected on OS X 10.10 and later. In |
// previous OS versions, if the initial client were to crash while attempting |
// to restart the handler, it would become an unkillable process. |
- exception_port_ = HandlerStarter::InitialStart( |
+ base::mac::ScopedMachSendRight exception_port(HandlerStarter::InitialStart( |
handler, |
database, |
url, |
annotations, |
arguments, |
- restartable && MacOSXMinorVersion() >= 10); |
- if (!exception_port_.is_valid()) { |
+ restartable && MacOSXMinorVersion() >= 10)); |
+ if (!exception_port.is_valid()) { |
return false; |
} |
+ SetHandlerMachPort(exception_port.Pass()); |
return true; |
} |
+bool CrashpadClient::SetHandlerMachService(const std::string& service_name) { |
+ base::mac::ScopedMachSendRight exception_port(BootstrapLookUp(service_name)); |
+ if (!exception_port.is_valid()) { |
+ return false; |
+ } |
+ |
+ SetHandlerMachPort(exception_port.Pass()); |
+ return true; |
+} |
+ |
+void CrashpadClient::SetHandlerMachPort( |
+ base::mac::ScopedMachSendRight exception_port) { |
+ DCHECK(exception_port.is_valid()); |
+ exception_port_ = exception_port.Pass(); |
+} |
+ |
bool CrashpadClient::UseHandler() { |
DCHECK(exception_port_.is_valid()); |