#include "remoting/test/fake_port_allocator.h"
#include <memory>
#include <string_view>
#include "base/functional/callback_helpers.h"
#include "remoting/protocol/transport_context.h"
#include "remoting/test/fake_network_dispatcher.h"
#include "remoting/test/fake_network_manager.h"
#include "remoting/test/fake_socket_factory.h"
#include "third_party/webrtc/p2p/client/basic_port_allocator.h"
namespace remoting {
namespace {
class FakePortAllocatorSession : public cricket::BasicPortAllocatorSession { … };
FakePortAllocatorSession::FakePortAllocatorSession(
FakePortAllocator* allocator,
const std::string& content_name,
int component,
const std::string& ice_username_fragment,
const std::string& ice_password)
: … { … }
FakePortAllocatorSession::~FakePortAllocatorSession() = default;
}
FakePortAllocator::FakePortAllocator(
rtc::NetworkManager* network_manager,
rtc::PacketSocketFactory* socket_factory,
scoped_refptr<protocol::TransportContext> transport_context)
: … { … }
FakePortAllocator::~FakePortAllocator() = default;
cricket::PortAllocatorSession* FakePortAllocator::CreateSessionInternal(
std::string_view content_name,
int component,
std::string_view ice_username_fragment,
std::string_view ice_password) { … }
FakePortAllocatorFactory::FakePortAllocatorFactory(
scoped_refptr<FakeNetworkDispatcher> fake_network_dispatcher) { … }
FakePortAllocatorFactory::~FakePortAllocatorFactory() = default;
protocol::PortAllocatorFactory::CreatePortAllocatorResult
FakePortAllocatorFactory::CreatePortAllocator(
scoped_refptr<protocol::TransportContext> transport_context,
base::WeakPtr<protocol::SessionOptionsProvider> session_options_provider) { … }
}