Crashpad
|
Runs the main exception-handling server in Crashpad’s handler process. More...
#include "util/win/exception_handler_server.h"
Classes | |
class | Delegate |
Public Member Functions | |
ExceptionHandlerServer (base::mac::ScopedMachReceiveRight receive_port, bool launchd) | |
Constructs an ExceptionHandlerServer object. More... | |
void | Run (UniversalMachExcServer::Interface *exception_interface) |
Runs the exception-handling server. More... | |
ExceptionHandlerServer (bool persistent) | |
Constructs the exception handling server. More... | |
void | SetPipeName (const std::wstring &pipe_name) |
Sets the pipe name to listen for client registrations on. More... | |
std::wstring | CreatePipe () |
Creates a randomized pipe name to listen for client registrations on and returns its name. More... | |
void | Run (Delegate *delegate) |
Runs the exception-handling server. More... | |
void | Stop () |
Stops the exception-handling server. Returns immediately. The object must not be destroyed until Run() returns. | |
Runs the main exception-handling server in Crashpad’s handler process.
Runs the main exception-handling server in Crashpad's handler process.
crashpad::ExceptionHandlerServer::ExceptionHandlerServer | ( | base::mac::ScopedMachReceiveRight | receive_port, |
bool | launchd | ||
) |
Constructs an ExceptionHandlerServer object.
[in] | receive_port | The port that exception messages and no-senders notifications will be received on. |
[in] | launchd | If true , the exception handler is being run from launchd. receive_port is not monitored for no-senders notifications, and instead, the expected “quit” signal is receipt of SIGTERM . |
|
explicit |
std::wstring crashpad::ExceptionHandlerServer::CreatePipe | ( | ) |
Creates a randomized pipe name to listen for client registrations on and returns its name.
Either this method or CreatePipe(), but not both, must be called before Run().
void crashpad::ExceptionHandlerServer::Run | ( | UniversalMachExcServer::Interface * | exception_interface | ) |
Runs the exception-handling server.
[in] | exception_interface | An object to send exception messages to. |
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 exception_interface.
This method must only be called once on an ExceptionHandlerServer object.
If an unexpected condition that prevents this method from functioning is encountered, it will log a message and terminate execution. Receipt of an invalid message on the receive port will cause a message to be logged, but this method will continue running normally.
void crashpad::ExceptionHandlerServer::Run | ( | Delegate * | delegate | ) |
Runs the exception-handling server.
[in] | delegate | The interface to which the exceptions are delegated when they are caught in Run(). Ownership is not transferred. |
void crashpad::ExceptionHandlerServer::SetPipeName | ( | const std::wstring & | pipe_name | ) |
Sets the pipe name to listen for client registrations on.
Either this method or CreatePipe(), but not both, must be called before Run().
[in] | pipe_name | The name of the pipe to listen on. Must be of the form "\\.\pipe\<some_name>". |