From aa918e0111389c12bc564657ba04ff4f42be8031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Thu, 12 Aug 2021 14:16:53 +0200 Subject: [PATCH] Delete always-true BasicPortAllocatorSession::AddAllocatedPort argument This is a private method, and the `prepare_address` argument was constant true at all call sites. Bug: None Change-Id: Id4714ee7c154a729a6e106c29895fc760e9d0455 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/228527 Reviewed-by: Harald Alvestrand Commit-Queue: Niels Moller Cr-Commit-Position: refs/heads/master@{#34739} --- p2p/client/basic_port_allocator.cc | 14 ++++++-------- p2p/client/basic_port_allocator.h | 4 +--- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/p2p/client/basic_port_allocator.cc b/p2p/client/basic_port_allocator.cc index 8ac505f49d..748be90908 100644 --- a/p2p/client/basic_port_allocator.cc +++ b/p2p/client/basic_port_allocator.cc @@ -872,8 +872,7 @@ void BasicPortAllocatorSession::DisableEquivalentPhases( } void BasicPortAllocatorSession::AddAllocatedPort(Port* port, - AllocationSequence* seq, - bool prepare_address) { + AllocationSequence* seq) { RTC_DCHECK_RUN_ON(network_thread_); if (!port) return; @@ -902,8 +901,7 @@ void BasicPortAllocatorSession::AddAllocatedPort(Port* port, port->SignalPortError.connect(this, &BasicPortAllocatorSession::OnPortError); RTC_LOG(LS_INFO) << port->ToString() << ": Added port to allocator"; - if (prepare_address) - port->PrepareAddress(); + port->PrepareAddress(); } void BasicPortAllocatorSession::OnAllocationSequenceObjectsCreated() { @@ -1440,7 +1438,7 @@ void AllocationSequence::CreateUDPPorts() { } } - session_->AddAllocatedPort(port.release(), this, true); + session_->AddAllocatedPort(port.release(), this); } } @@ -1456,7 +1454,7 @@ void AllocationSequence::CreateTCPPorts() { session_->username(), session_->password(), session_->allocator()->allow_tcp_listen()); if (port) { - session_->AddAllocatedPort(port.release(), this, true); + session_->AddAllocatedPort(port.release(), this); // Since TCPPort is not created using shared socket, `port` will not be // added to the dequeue. } @@ -1485,7 +1483,7 @@ void AllocationSequence::CreateStunPorts() { session_->allocator()->origin(), session_->allocator()->stun_candidate_keepalive_interval()); if (port) { - session_->AddAllocatedPort(port.release(), this, true); + session_->AddAllocatedPort(port.release(), this); // Since StunPort is not created using shared socket, `port` will not be // added to the dequeue. } @@ -1581,7 +1579,7 @@ void AllocationSequence::CreateTurnPort(const RelayServerConfig& config) { } } RTC_DCHECK(port != NULL); - session_->AddAllocatedPort(port.release(), this, true); + session_->AddAllocatedPort(port.release(), this); } } diff --git a/p2p/client/basic_port_allocator.h b/p2p/client/basic_port_allocator.h index 88758c3a01..3fca9be688 100644 --- a/p2p/client/basic_port_allocator.h +++ b/p2p/client/basic_port_allocator.h @@ -227,9 +227,7 @@ class RTC_EXPORT BasicPortAllocatorSession : public PortAllocatorSession { void DisableEquivalentPhases(rtc::Network* network, PortConfiguration* config, uint32_t* flags); - void AddAllocatedPort(Port* port, - AllocationSequence* seq, - bool prepare_address); + void AddAllocatedPort(Port* port, AllocationSequence* seq); void OnCandidateReady(Port* port, const Candidate& c); void OnCandidateError(Port* port, const IceCandidateErrorEvent& event); void OnPortComplete(Port* port);