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

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

Issue 2566833002: Don't allow changing ICE pool size after SetLocalDescription. (Closed)
Patch Set: Fixing signed/unsigned compare warning. Created 4 years 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/api/peerconnectioninterface_unittest.cc ('k') | webrtc/p2p/base/portallocator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/portallocator.h
diff --git a/webrtc/p2p/base/portallocator.h b/webrtc/p2p/base/portallocator.h
index 3c81068060a3a717f94e329db7ed541dc86c9e51..a61d6426a56a5c622482276984431b494a96ef6a 100644
--- a/webrtc/p2p/base/portallocator.h
+++ b/webrtc/p2p/base/portallocator.h
@@ -298,7 +298,9 @@ class PortAllocator : public sigslot::has_slots<> {
//
// If the servers are not changing but the candidate pool size is,
// pooled sessions will be either created or destroyed as necessary.
- void SetConfiguration(const ServerAddresses& stun_servers,
+ //
+ // Returns true if the configuration could successfully be changed.
+ bool SetConfiguration(const ServerAddresses& stun_servers,
const std::vector<RelayServerConfig>& turn_servers,
int candidate_pool_size,
bool prune_turn_ports);
@@ -309,7 +311,7 @@ class PortAllocator : public sigslot::has_slots<> {
return turn_servers_;
}
- int candidate_pool_size() const { return target_pooled_session_count_; }
+ int candidate_pool_size() const { return candidate_pool_size_; }
// Sets the network types to ignore.
// Values are defined by the AdapterType enum.
@@ -412,11 +414,7 @@ class PortAllocator : public sigslot::has_slots<> {
private:
ServerAddresses stun_servers_;
std::vector<RelayServerConfig> turn_servers_;
- // The last size passed into SetConfiguration.
- int target_pooled_session_count_ = 0;
- // This variable represents the total number of pooled sessions
- // both owned by this class and taken by TakePooledSession.
- int allocated_pooled_session_count_ = 0;
+ int candidate_pool_size_ = 0; // Last value passed into SetConfiguration.
std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_;
bool prune_turn_ports_ = false;
« no previous file with comments | « webrtc/api/peerconnectioninterface_unittest.cc ('k') | webrtc/p2p/base/portallocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698