summaryrefslogtreecommitdiffstats
path: root/third_party/libwebrtc/p2p/client/basic_port_allocator.cc
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--third_party/libwebrtc/p2p/client/basic_port_allocator.cc35
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(