diff --git a/p2p/client/basic_port_allocator.cc b/p2p/client/basic_port_allocator.cc index ac1901bc17..ccdd37dc41 100644 --- a/p2p/client/basic_port_allocator.cc +++ b/p2p/client/basic_port_allocator.cc @@ -191,22 +191,6 @@ BasicPortAllocator::BasicPortAllocator( RTC_CHECK(socket_factory_ != nullptr); } -BasicPortAllocator::BasicPortAllocator( - rtc::NetworkManager* network_manager, - std::unique_ptr owned_socket_factory, - const ServerAddresses& stun_servers, - const webrtc::FieldTrialsView* field_trials) - : field_trials_(field_trials), - network_manager_(network_manager), - socket_factory_(std::move(owned_socket_factory)) { - Init(nullptr); - RTC_DCHECK(relay_port_factory_ != nullptr); - RTC_DCHECK(network_manager_ != nullptr); - RTC_CHECK(socket_factory_ != nullptr); - SetConfiguration(stun_servers, std::vector(), 0, - webrtc::NO_PRUNE, nullptr); -} - BasicPortAllocator::BasicPortAllocator( rtc::NetworkManager* network_manager, rtc::PacketSocketFactory* socket_factory, diff --git a/p2p/client/basic_port_allocator.h b/p2p/client/basic_port_allocator.h index 38c3835ee8..7e30012e47 100644 --- a/p2p/client/basic_port_allocator.h +++ b/p2p/client/basic_port_allocator.h @@ -45,11 +45,6 @@ class RTC_EXPORT BasicPortAllocator : public PortAllocator { rtc::NetworkManager* network_manager, std::unique_ptr owned_socket_factory, const webrtc::FieldTrialsView* field_trials = nullptr); - BasicPortAllocator( - rtc::NetworkManager* network_manager, - std::unique_ptr owned_socket_factory, - const ServerAddresses& stun_servers, - const webrtc::FieldTrialsView* field_trials = nullptr); BasicPortAllocator(rtc::NetworkManager* network_manager, rtc::PacketSocketFactory* socket_factory, const ServerAddresses& stun_servers, diff --git a/p2p/client/basic_port_allocator_unittest.cc b/p2p/client/basic_port_allocator_unittest.cc index 44e39c39ac..7b2bba4293 100644 --- a/p2p/client/basic_port_allocator_unittest.cc +++ b/p2p/client/basic_port_allocator_unittest.cc @@ -157,6 +157,7 @@ class BasicPortAllocatorTestBase : public ::testing::Test, BasicPortAllocatorTestBase() : vss_(new rtc::VirtualSocketServer()), fss_(new rtc::FirewallSocketServer(vss_.get())), + socket_factory_(fss_.get()), thread_(fss_.get()), // Note that the NAT is not used by default. ResetWithStunServerAndNat // must be called. @@ -172,9 +173,7 @@ class BasicPortAllocatorTestBase : public ::testing::Test, stun_servers.insert(kStunAddr); allocator_ = std::make_unique( - &network_manager_, - std::make_unique(fss_.get()), - stun_servers, &field_trials_); + &network_manager_, &socket_factory_, stun_servers, &field_trials_); allocator_->Initialize(); allocator_->set_step_delay(kMinimumStepDelay); allocator_->SetIceTiebreaker(kTiebreakerDefault); @@ -518,6 +517,7 @@ class BasicPortAllocatorTestBase : public ::testing::Test, std::unique_ptr vss_; std::unique_ptr fss_; + rtc::BasicPacketSocketFactory socket_factory_; rtc::AutoSocketServerThread thread_; std::unique_ptr nat_server_; rtc::NATSocketFactory nat_factory_;