#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "remoting/protocol/fake_datagram_socket.h"
#include <utility>
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/task/single_thread_task_runner.h"
#include "net/base/address_list.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace remoting::protocol {
FakeDatagramSocket::FakeDatagramSocket()
: … { … }
FakeDatagramSocket::~FakeDatagramSocket() { … }
void FakeDatagramSocket::AppendInputPacket(const std::string& data) { … }
void FakeDatagramSocket::PairWith(FakeDatagramSocket* peer_socket) { … }
base::WeakPtr<FakeDatagramSocket> FakeDatagramSocket::GetWeakPtr() { … }
int FakeDatagramSocket::Recv(const scoped_refptr<net::IOBuffer>& buf,
int buf_len,
const net::CompletionRepeatingCallback& callback) { … }
int FakeDatagramSocket::Send(const scoped_refptr<net::IOBuffer>& buf,
int buf_len,
const net::CompletionRepeatingCallback& callback) { … }
void FakeDatagramSocket::DoAsyncSend(
const scoped_refptr<net::IOBuffer>& buf,
int buf_len,
const net::CompletionRepeatingCallback& callback) { … }
int FakeDatagramSocket::DoSend(const scoped_refptr<net::IOBuffer>& buf,
int buf_len) { … }
int FakeDatagramSocket::CopyReadData(const scoped_refptr<net::IOBuffer>& buf,
int buf_len) { … }
FakeDatagramChannelFactory::FakeDatagramChannelFactory()
: … { … }
FakeDatagramChannelFactory::~FakeDatagramChannelFactory() { … }
void FakeDatagramChannelFactory::PairWith(
FakeDatagramChannelFactory* peer_factory) { … }
FakeDatagramSocket* FakeDatagramChannelFactory::GetFakeChannel(
const std::string& name) { … }
void FakeDatagramChannelFactory::CreateChannel(
const std::string& name,
ChannelCreatedCallback callback) { … }
void FakeDatagramChannelFactory::NotifyChannelCreated(
std::unique_ptr<FakeDatagramSocket> owned_socket,
const std::string& name,
ChannelCreatedCallback callback) { … }
void FakeDatagramChannelFactory::CancelChannelCreation(
const std::string& name) { … }
}