#include "ipc/ipc_channel_proxy.h"
#include <stddef.h>
#include <stdint.h>
#include <utility>
#include "base/compiler_specific.h"
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
#include "base/task/single_thread_task_runner.h"
#include "build/build_config.h"
#include "ipc/ipc_channel_factory.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_logging.h"
#include "ipc/ipc_message_macros.h"
#include "ipc/message_filter.h"
#include "ipc/message_filter_router.h"
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
namespace IPC {
ChannelProxy::Context::Context(
Listener* listener,
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
const scoped_refptr<base::SingleThreadTaskRunner>& listener_task_runner)
: … { … }
ChannelProxy::Context::~Context() = default;
void ChannelProxy::Context::ClearIPCTaskRunner() { … }
void ChannelProxy::Context::CreateChannel(
std::unique_ptr<ChannelFactory> factory) { … }
bool ChannelProxy::Context::TryFilters(const Message& message) { … }
void ChannelProxy::Context::PauseChannel() { … }
void ChannelProxy::Context::UnpauseChannel(bool flush) { … }
void ChannelProxy::Context::FlushChannel() { … }
bool ChannelProxy::Context::OnMessageReceived(const Message& message) { … }
bool ChannelProxy::Context::OnMessageReceivedNoFilter(const Message& message) { … }
void ChannelProxy::Context::OnChannelConnected(int32_t peer_pid) { … }
void ChannelProxy::Context::OnChannelError() { … }
void ChannelProxy::Context::OnAssociatedInterfaceRequest(
const std::string& interface_name,
mojo::ScopedInterfaceEndpointHandle handle) { … }
void ChannelProxy::Context::OnChannelOpened() { … }
void ChannelProxy::Context::OnChannelClosed() { … }
void ChannelProxy::Context::Clear() { … }
void ChannelProxy::Context::OnSendMessage(std::unique_ptr<Message> message) { … }
void ChannelProxy::Context::OnAddFilter() { … }
void ChannelProxy::Context::OnRemoveFilter(MessageFilter* filter) { … }
void ChannelProxy::Context::AddFilter(MessageFilter* filter) { … }
void ChannelProxy::Context::OnDispatchMessage(const Message& message) { … }
void ChannelProxy::Context::AddListenerTaskRunner(
int32_t routing_id,
scoped_refptr<base::SingleThreadTaskRunner> task_runner) { … }
void ChannelProxy::Context::RemoveListenerTaskRunner(int32_t routing_id) { … }
scoped_refptr<base::SingleThreadTaskRunner>
ChannelProxy::Context::GetTaskRunner(int32_t routing_id) { … }
void ChannelProxy::Context::OnDispatchConnected() { … }
void ChannelProxy::Context::OnDispatchError() { … }
void ChannelProxy::Context::OnDispatchBadMessage(const Message& message) { … }
void ChannelProxy::Context::OnDispatchAssociatedInterfaceRequest(
const std::string& interface_name,
mojo::ScopedInterfaceEndpointHandle handle) { … }
void ChannelProxy::Context::ClearChannel() { … }
void ChannelProxy::Context::AddGenericAssociatedInterfaceForIOThread(
const std::string& name,
const GenericAssociatedInterfaceFactory& factory) { … }
void ChannelProxy::Context::Send(Message* message) { … }
void ChannelProxy::Context::SetUrgentMessageObserver(
UrgentMessageObserver* observer) { … }
std::unique_ptr<ChannelProxy> ChannelProxy::Create(
const IPC::ChannelHandle& channel_handle,
Channel::Mode mode,
Listener* listener,
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
const scoped_refptr<base::SingleThreadTaskRunner>& listener_task_runner) { … }
std::unique_ptr<ChannelProxy> ChannelProxy::Create(
std::unique_ptr<ChannelFactory> factory,
Listener* listener,
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
const scoped_refptr<base::SingleThreadTaskRunner>& listener_task_runner) { … }
ChannelProxy::ChannelProxy(Context* context) : … { … }
ChannelProxy::ChannelProxy(
Listener* listener,
const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner,
const scoped_refptr<base::SingleThreadTaskRunner>& listener_task_runner)
: … { … }
ChannelProxy::~ChannelProxy() { … }
void ChannelProxy::Init(const IPC::ChannelHandle& channel_handle,
Channel::Mode mode,
bool create_pipe_now) { … }
void ChannelProxy::Init(std::unique_ptr<ChannelFactory> factory,
bool create_pipe_now) { … }
void ChannelProxy::Pause() { … }
void ChannelProxy::Unpause(bool flush) { … }
void ChannelProxy::Flush() { … }
void ChannelProxy::Close() { … }
bool ChannelProxy::Send(Message* message) { … }
void ChannelProxy::SendInternal(Message* message) { … }
void ChannelProxy::AddFilter(MessageFilter* filter) { … }
void ChannelProxy::RemoveFilter(MessageFilter* filter) { … }
void ChannelProxy::AddGenericAssociatedInterfaceForIOThread(
const std::string& name,
const GenericAssociatedInterfaceFactory& factory) { … }
void ChannelProxy::GetRemoteAssociatedInterface(
mojo::GenericPendingAssociatedReceiver receiver) { … }
void ChannelProxy::ClearIPCTaskRunner() { … }
void ChannelProxy::OnChannelInit() { … }
void ChannelProxy::SetUrgentMessageObserver(UrgentMessageObserver* observer) { … }
}