From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- .../libwebrtc/p2p/client/basic_port_allocator.cc | 35 +++++++--------------- 1 file changed, 11 insertions(+), 24 deletions(-) (limited to 'third_party/libwebrtc/p2p/client/basic_port_allocator.cc') diff --git a/third_party/libwebrtc/p2p/client/basic_port_allocator.cc b/third_party/libwebrtc/p2p/client/basic_port_allocator.cc index e8255f1fd5..e95033efeb 100644 --- a/third_party/libwebrtc/p2p/client/basic_port_allocator.cc +++ b/third_party/libwebrtc/p2p/client/basic_port_allocator.cc @@ -126,11 +126,15 @@ bool IsAllowedByCandidateFilter(const Candidate& c, uint32_t filter) { return false; } - if (c.type() == RELAY_PORT_TYPE) { + if (c.is_relay()) { return ((filter & CF_RELAY) != 0); - } else if (c.type() == STUN_PORT_TYPE) { + } + + if (c.is_stun()) { return ((filter & CF_REFLEXIVE) != 0); - } else if (c.type() == LOCAL_PORT_TYPE) { + } + + if (c.is_local()) { if ((filter & CF_REFLEXIVE) && !c.address().IsPrivateIP()) { // We allow host candidates if the filter allows server-reflexive // candidates and the candidate is a public IP. Because we don't generate @@ -143,6 +147,7 @@ bool IsAllowedByCandidateFilter(const Candidate& c, uint32_t filter) { return ((filter & CF_HOST) != 0); } + return false; } @@ -199,21 +204,6 @@ BasicPortAllocator::BasicPortAllocator( webrtc::NO_PRUNE, nullptr); } -void BasicPortAllocator::OnIceRegathering(PortAllocatorSession* session, - IceRegatheringReason reason) { - // If the session has not been taken by an active channel, do not report the - // metric. - for (auto& allocator_session : pooled_sessions()) { - if (allocator_session.get() == session) { - return; - } - } - - RTC_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.IceRegatheringReason", - static_cast(reason), - static_cast(IceRegatheringReason::MAX_VALUE)); -} - BasicPortAllocator::~BasicPortAllocator() { CheckRunOnValidThreadIfInitialized(); // Our created port allocator sessions depend on us, so destroy our remaining @@ -251,12 +241,9 @@ PortAllocatorSession* BasicPortAllocator::CreateSessionInternal( absl::string_view ice_ufrag, absl::string_view ice_pwd) { CheckRunOnValidThreadAndInitialized(); - PortAllocatorSession* session = new BasicPortAllocatorSession( - this, std::string(content_name), component, std::string(ice_ufrag), - std::string(ice_pwd)); - session->SignalIceRegathering.connect(this, - &BasicPortAllocator::OnIceRegathering); - return session; + return new BasicPortAllocatorSession(this, std::string(content_name), + component, std::string(ice_ufrag), + std::string(ice_pwd)); } void BasicPortAllocator::AddTurnServerForTesting( -- cgit v1.2.3