Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: webrtc/p2p/base/portallocator.cc

Issue 1998813002: Fixing the behavior of the candidate filter with pooled candidates. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Undoing unintentional "git cl format" of unrelated files. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/base/portallocator.h ('k') | webrtc/p2p/base/portallocator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/portallocator.cc
diff --git a/webrtc/p2p/base/portallocator.cc b/webrtc/p2p/base/portallocator.cc
index fdf213b31198abed093a4f6d1c3bc98ccddee3e7..f9f87b007f2b2e0ca19ba870f3ff754b6d21f6cd 100644
--- a/webrtc/p2p/base/portallocator.cc
+++ b/webrtc/p2p/base/portallocator.cc
@@ -71,8 +71,10 @@ std::unique_ptr<PortAllocatorSession> PortAllocator::CreateSession(
int component,
const std::string& ice_ufrag,
const std::string& ice_pwd) {
- return std::unique_ptr<PortAllocatorSession>(
+ auto session = std::unique_ptr<PortAllocatorSession>(
CreateSessionInternal(content_name, component, ice_ufrag, ice_pwd));
+ session->SetCandidateFilter(candidate_filter());
+ return session;
}
std::unique_ptr<PortAllocatorSession> PortAllocator::TakePooledSession(
@@ -88,6 +90,9 @@ std::unique_ptr<PortAllocatorSession> PortAllocator::TakePooledSession(
std::unique_ptr<PortAllocatorSession> ret =
std::move(pooled_sessions_.front());
ret->SetIceParameters(content_name, component, ice_ufrag, ice_pwd);
+ // According to JSEP, a pooled session should filter candidates only after
+ // it's taken out of the pool.
+ ret->SetCandidateFilter(candidate_filter());
pooled_sessions_.pop_front();
return ret;
}
« no previous file with comments | « webrtc/p2p/base/portallocator.h ('k') | webrtc/p2p/base/portallocator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698