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

Unified Diff: client/crashpad_client_mac.cc

Issue 1414533006: mac: Add a mode to crashpad_handler to run from launchd (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: Rebase Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/crashpad_client.h ('k') | handler/crashpad_handler.ad » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « client/crashpad_client.h ('k') | handler/crashpad_handler.ad » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698