diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:35:49 +0000 |
commit | d8bbc7858622b6d9c278469aab701ca0b609cddf (patch) | |
tree | eff41dc61d9f714852212739e6b3738b82a2af87 /third_party/libwebrtc/p2p/client/basic_port_allocator.cc | |
parent | Releasing progress-linux version 125.0.3-1~progress7.99u1. (diff) | |
download | firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | third_party/libwebrtc/p2p/client/basic_port_allocator.cc | 35 |
1 files changed, 11 insertions, 24 deletions
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<int>(reason), - static_cast<int>(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( |