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

Unified Diff: handler/mac/exception_handler_server.h

Issue 1429353002: mac: Scope crashpad_handler’s SIGTERM handler more broadly (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/handler_main.cc ('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 df9d5a0d0dcc3d5af620ef2f10692b239f203887..421038e3e53e114f4442302bf84795a8e89e1fb4 100644
--- a/handler/mac/exception_handler_server.h
+++ b/handler/mac/exception_handler_server.h
@@ -34,8 +34,8 @@ class ExceptionHandlerServer {
//! notifications will be received on.
//! \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`.
+ //! notifications, and instead, Stop() must be called to provide a “quit”
+ //! signal.
ExceptionHandlerServer(base::mac::ScopedMachReceiveRight receive_port,
bool launchd);
~ExceptionHandlerServer();
@@ -47,11 +47,10 @@ class ExceptionHandlerServer {
//! 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.
+ //! notification, or until Stop() is called. 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.
//!
@@ -63,8 +62,19 @@ class ExceptionHandlerServer {
//! this method will continue running normally.
void Run(UniversalMachExcServer::Interface* exception_interface);
+ //! \brief Stops a running exception-handling server.
+ //!
+ //! The normal mode of operation is to call Stop() while Run() is running. It
+ //! is expected that Stop() would be called from a signal handler.
+ //!
+ //! If Stop() is called before Run() it will cause Run() to return as soon as
+ //! it is called. It is harmless to call Stop() after Run() has already
+ //! returned, or to call Stop() after it has already been called.
+ void Stop();
+
private:
base::mac::ScopedMachReceiveRight receive_port_;
+ base::mac::ScopedMachReceiveRight notify_port_;
bool launchd_;
DISALLOW_COPY_AND_ASSIGN(ExceptionHandlerServer);
« no previous file with comments | « handler/handler_main.cc ('k') | handler/mac/exception_handler_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698