class Client

Defined at line 46 of file ../../third_party/perfetto/include/perfetto/ext/ipc/client.h

The client-side class that talks to the host over the socket and multiplexes

requests coming from the various autogenerated ServiceProxy stubs.

This is meant to be used by the user code as follows:

auto client = Client::CreateInstance("socket_name", task_runner);

std::unique_ptr

<GreeterService

> svc(new GreeterService());

client.BindService(svc);

svc.OnConnect([] () {

svc.SayHello(..., ...);

});

Public Methods

std::unique_ptr<Client> CreateInstance (ConnArgs , base::TaskRunner * )
void ~Client ()
void BindService (base::WeakPtr<ServiceProxy> )
void UnbindService (ServiceID )

There is no need to call this method explicitly. Destroying the

ServiceProxy instance is sufficient and will automatically unbind it. This

method is exposed only for the ServiceProxy destructor.

base::ScopedFile TakeReceivedFD ()

Returns (with move semantics) the last file descriptor received on the IPC

channel. No buffering is performed: if a service sends two file descriptors

and the caller doesn't read them immediately, the first one will be

automatically closed when the second is received (and will hit a DCHECK in

debug builds).

Records