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

Unified Diff: handler/mac/exception_handler_server.h

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 | « handler/crashpad_handler.ad ('k') | handler/mac/exception_handler_server.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: handler/mac/exception_handler_server.h
diff --git a/handler/mac/exception_handler_server.h b/handler/mac/exception_handler_server.h
index 05c4056fe19a41e2fb933422b503edeafac5735f..df9d5a0d0dcc3d5af620ef2f10692b239f203887 100644
--- a/handler/mac/exception_handler_server.h
+++ b/handler/mac/exception_handler_server.h
@@ -32,20 +32,26 @@ class ExceptionHandlerServer {
//!
//! \param[in] receive_port The port that exception messages and no-senders
//! notifications will be received on.
- explicit ExceptionHandlerServer(
- base::mac::ScopedMachReceiveRight receive_port);
+ //! \param[in] launchd If `true`, the exception handler is being run from
+ //! launchd. \a receive_port is not monitored for no-senders
+ //! notifications, and instead, the expected “quit” signal is receipt of
+ //! `SIGTERM`.
+ ExceptionHandlerServer(base::mac::ScopedMachReceiveRight receive_port,
+ bool launchd);
~ExceptionHandlerServer();
//! \brief Runs the exception-handling server.
//!
//! \param[in] exception_interface An object to send exception messages to.
//!
- //! This method monitors the receive port for exception messages and
- //! no-senders notifications. It continues running until it has no more
- //! clients, indicated by the receipt of a no-senders notification. It is
- //! important to assure that a send right exists in a client (or has been
- //! queued by `mach_msg()` to be sent to a client) prior to calling this
- //! method, or it will detect that it is sender-less and return immediately.
+ //! This method monitors the receive port for exception messages and, if
+ //! not being run by launchd, no-senders notifications. It continues running
+ //! until it has no more clients, indicated by the receipt of a no-senders
+ //! notification, or if being run by launchd, receipt of `SIGTERM`. When not
+ //! being run by launchd, it is important to assure that a send right exists
+ //! in a client (or has been queued by `mach_msg()` to be sent to a client)
+ //! prior to calling this method, or it will detect that it is sender-less and
+ //! return immediately.
//!
//! All exception messages will be passed to \a exception_interface.
//!
@@ -59,6 +65,7 @@ class ExceptionHandlerServer {
private:
base::mac::ScopedMachReceiveRight receive_port_;
+ bool launchd_;
DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerServer);
};
« no previous file with comments | « handler/crashpad_handler.ad ('k') | handler/mac/exception_handler_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698