#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "remoting/host/native_messaging/native_messaging_reader.h"
#include <cstdint>
#include <memory>
#include <string>
#include <utility>
#include "base/files/file.h"
#include "base/functional/bind.h"
#include "base/json/json_reader.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/message_loop/message_pump_type.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/threading/thread.h"
#include "base/values.h"
#include "build/build_config.h"
#if BUILDFLAG(IS_WIN)
#include <windows.h>
#include "base/threading/platform_thread.h"
#include "base/win/scoped_handle.h"
#endif
namespace {
MessageLengthType;
const int kMessageHeaderSize = …;
const MessageLengthType kMaximumMessageSize = …;
}
namespace remoting {
class NativeMessagingReader::Core { … };
NativeMessagingReader::Core::Core(
base::File file,
scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner,
scoped_refptr<base::SequencedTaskRunner> read_task_runner,
base::WeakPtr<NativeMessagingReader> reader)
: … { … }
NativeMessagingReader::Core::~Core() = default;
void NativeMessagingReader::Core::ReadMessage() { … }
void NativeMessagingReader::Core::NotifyEof() { … }
NativeMessagingReader::NativeMessagingReader(base::File file)
: … { … }
NativeMessagingReader::~NativeMessagingReader() { … }
void NativeMessagingReader::Start(const MessageCallback& message_callback,
base::OnceClosure eof_callback) { … }
void NativeMessagingReader::InvokeMessageCallback(base::Value message) { … }
void NativeMessagingReader::InvokeEofCallback() { … }
}