Remove BasicPortAllocator ctor that's not used in production

The additional constructor unnecessarily increases the complexity
of the class and other downstream classes.

Bug: none
Change-Id: Ied797feb3c982a50b7b47e65018cfc90ca90bf6f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/318280
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#40671}
This commit is contained in:
Tommi 2023-08-30 10:07:06 +02:00 committed by WebRTC LUCI CQ
parent 96e1882860
commit fe57cecdfe
3 changed files with 3 additions and 24 deletions

View File

@ -191,22 +191,6 @@ BasicPortAllocator::BasicPortAllocator(
RTC_CHECK(socket_factory_ != nullptr);
}
BasicPortAllocator::BasicPortAllocator(
rtc::NetworkManager* network_manager,
std::unique_ptr<rtc::PacketSocketFactory> 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<RelayServerConfig>(), 0,
webrtc::NO_PRUNE, nullptr);
}
BasicPortAllocator::BasicPortAllocator(
rtc::NetworkManager* network_manager,
rtc::PacketSocketFactory* socket_factory,

View File

@ -45,11 +45,6 @@ class RTC_EXPORT BasicPortAllocator : public PortAllocator {
rtc::NetworkManager* network_manager,
std::unique_ptr<rtc::PacketSocketFactory> owned_socket_factory,
const webrtc::FieldTrialsView* field_trials = nullptr);
BasicPortAllocator(
rtc::NetworkManager* network_manager,
std::unique_ptr<rtc::PacketSocketFactory> 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,

View File

@ -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<BasicPortAllocator>(
&network_manager_,
std::make_unique<rtc::BasicPacketSocketFactory>(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<rtc::VirtualSocketServer> vss_;
std::unique_ptr<rtc::FirewallSocketServer> fss_;
rtc::BasicPacketSocketFactory socket_factory_;
rtc::AutoSocketServerThread thread_;
std::unique_ptr<rtc::NATServer> nat_server_;
rtc::NATSocketFactory nat_factory_;