#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "ipc/ipc_channel_reader.h"
#include <stddef.h>
#include <algorithm>
#include "base/logging.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_logging.h"
#include "ipc/ipc_message.h"
#include "ipc/ipc_message_attachment_set.h"
#include "ipc/ipc_message_macros.h"
namespace IPC {
namespace internal {
#if BUILDFLAG(IPC_MESSAGE_LOG_ENABLED)
namespace {
std::string GetMessageText(const Message& message) { … }
}
#define EMIT_TRACE_EVENT(message) …
#else
#define EMIT_TRACE_EVENT …
#endif
ChannelReader::ChannelReader(Listener* listener)
: … { … }
ChannelReader::~ChannelReader() = default;
ChannelReader::DispatchState ChannelReader::ProcessIncomingMessages() { … }
ChannelReader::DispatchState ChannelReader::AsyncReadComplete(int bytes_read) { … }
bool ChannelReader::IsInternalMessage(const Message& m) { … }
bool ChannelReader::IsHelloMessage(const Message& m) { … }
void ChannelReader::CleanUp() { … }
void ChannelReader::DispatchMessage(Message* m) { … }
bool ChannelReader::TranslateInputData(const char* input_data,
int input_data_len) { … }
bool ChannelReader::HandleTranslatedMessage(Message* translated_message) { … }
bool ChannelReader::HandleExternalMessage(Message* external_message) { … }
void ChannelReader::HandleDispatchError(const Message& message) { … }
bool ChannelReader::CheckMessageSize(size_t size) { … }
}
}