class Host
Defined at line 40 of file ../../third_party/perfetto/include/perfetto/ext/ipc/host.h
The host-side of the IPC layer. This class acts as a registry and request
dispatcher. It listen on the UnixSocket |socket_name| for incoming requests
(coming Client instances) and dispatches their requests to the various
Services exposed.
Public Methods
std::unique_ptr<Host> CreateInstance (const char * socket_name, base::TaskRunner * )
Creates an instance and starts listening on the given |socket_name|.
Returns nullptr if listening on the socket fails.
std::unique_ptr<Host> CreateInstance (base::ScopedSocketHandle , base::TaskRunner * )
Like the above but takes a file descriptor to a pre-bound unix socket.
Returns nullptr if listening on the socket fails.
std::unique_ptr<Host> CreateInstance_Fuchsia (base::TaskRunner * )
Creates a Host which is not backed by a POSIX listening socket.
Instead, it accepts sockets passed in via AdoptConnectedSocket_Fuchsia().
See go/fuchsetto for more details.
void ~Host ()
bool ExposeService (std::unique_ptr<Service> )
Registers a new service and makes it available to remote IPC peers.
All the exposed Service instances will be destroyed when destroying the
Host instance if ExposeService succeeds and returns true, or immediately
after the call in case of failure.
Returns true if the register has been successfully registered, false in
case of errors (e.g., another service with the same name is already
registered).
void AdoptConnectedSocket_Fuchsia (base::ScopedSocketHandle , std::function<bool (int)> send_fd_cb)
Accepts a pre-connected socket handle and a callback used to send a
shared memory FD to the remote client.
The callback returns false if the FD could not be sent.
Should only be used in conjunction with CreateInstance_Fuchsia().
void SetSocketSendTimeoutMs (uint32_t timeout_ms)
Overrides the default send timeout for the per-connection sockets.