#include "src/ipc/client_impl.h"
#include <fcntl.h>
#include <cinttypes>
#include <utility>
#include "perfetto/base/task_runner.h"
#include "perfetto/ext/base/unix_socket.h"
#include "perfetto/ext/base/utils.h"
#include "perfetto/ext/ipc/service_descriptor.h"
#include "perfetto/ext/ipc/service_proxy.h"
#include "protos/perfetto/ipc/wire_protocol.gen.h"
namespace perfetto {
namespace ipc {
namespace {
constexpr base::SockFamily kClientSockFamily = …;
}
std::unique_ptr<Client> Client::CreateInstance(ConnArgs conn_args,
base::TaskRunner* task_runner) { … }
ClientImpl::ClientImpl(ConnArgs conn_args, base::TaskRunner* task_runner)
: … { … }
ClientImpl::~ClientImpl() { … }
void ClientImpl::TryConnect() { … }
void ClientImpl::BindService(base::WeakPtr<ServiceProxy> service_proxy) { … }
void ClientImpl::UnbindService(ServiceID service_id) { … }
RequestID ClientImpl::BeginInvoke(ServiceID service_id,
const std::string& method_name,
MethodID remote_method_id,
const ProtoMessage& method_args,
bool drop_reply,
base::WeakPtr<ServiceProxy> service_proxy,
int fd) { … }
bool ClientImpl::SendFrame(const Frame& frame, int fd) { … }
void ClientImpl::OnConnect(base::UnixSocket*, bool connected) { … }
void ClientImpl::OnDisconnect(base::UnixSocket*) { … }
void ClientImpl::OnDataAvailable(base::UnixSocket*) { … }
void ClientImpl::OnFrameReceived(const Frame& frame) { … }
void ClientImpl::OnBindServiceReply(QueuedRequest req,
const Frame::BindServiceReply& reply) { … }
void ClientImpl::OnInvokeMethodReply(QueuedRequest req,
const Frame::InvokeMethodReply& reply) { … }
ClientImpl::QueuedRequest::QueuedRequest() = default;
base::ScopedFile ClientImpl::TakeReceivedFD() { … }
}
}