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

Side by Side Diff: webrtc/p2p/base/portallocator.h

Issue 2124283003: Fixing inconsistency with behavior of `ClearGettingPorts`. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 const std::string& ice_pwd() const { return ice_pwd_; } 151 const std::string& ice_pwd() const { return ice_pwd_; }
152 bool pooled() const { return ice_ufrag_.empty(); } 152 bool pooled() const { return ice_ufrag_.empty(); }
153 153
154 // Setting this filter should affect not only candidates gathered in the 154 // Setting this filter should affect not only candidates gathered in the
155 // future, but candidates already gathered and ports already "ready", 155 // future, but candidates already gathered and ports already "ready",
156 // which would be returned by ReadyCandidates() and ReadyPorts(). 156 // which would be returned by ReadyCandidates() and ReadyPorts().
157 // 157 //
158 // Default filter should be CF_ALL. 158 // Default filter should be CF_ALL.
159 virtual void SetCandidateFilter(uint32_t filter) = 0; 159 virtual void SetCandidateFilter(uint32_t filter) = 0;
160 160
161 // Starts gathering STUN and Relay configurations. 161 // Starts gathering ports and ICE candidates.
162 virtual void StartGettingPorts() = 0; 162 virtual void StartGettingPorts() = 0;
163 // Completely stops the gathering process and will not start new ones. 163 // Completely stops gathering. Will not gather again unless StartGettingPorts
164 // is called again.
164 virtual void StopGettingPorts() = 0; 165 virtual void StopGettingPorts() = 0;
165 // Whether the session is actively getting ports. 166 // Whether the session is actively getting ports.
166 virtual bool IsGettingPorts() = 0; 167 virtual bool IsGettingPorts() = 0;
167 // ClearGettingPorts and IsCleared are used by continual gathering. 168
168 // Only stops the existing gathering process but may start new ones if needed. 169 //
170 // NOTE: The group of methods below is only used for continual gathering.
171 //
172
173 // ClearGettingPorts should have the same immediate effect as
174 // StopGettingPorts, but if the implementation supports continual gathering,
175 // ClearGettingPorts allows additional ports/candidates to be gathered if the
176 // network conditions change.
169 virtual void ClearGettingPorts() = 0; 177 virtual void ClearGettingPorts() = 0;
170 // Whether it is in the state where the existing gathering process is stopped, 178 // Whether it is in the state where the existing gathering process is stopped,
171 // but new ones may be started (basically after calling ClearGettingPorts). 179 // but new ones may be started (basically after calling ClearGettingPorts).
172 virtual bool IsCleared() const { return false; } 180 virtual bool IsCleared() const { return false; }
173 // Whether the session has completely stopped. 181 // Whether the session has completely stopped.
174 virtual bool IsStopped() const { return false; } 182 virtual bool IsStopped() const { return false; }
175 // Re-gathers candidates on networks that do not have any connections. More 183 // Re-gathers candidates on networks that do not have any connections. More
176 // precisely, a network interface may have more than one IP addresses (e.g., 184 // precisely, a network interface may have more than one IP addresses (e.g.,
177 // IPv4 and IPv6 addresses). Each address subnet will be used to create a 185 // IPv4 and IPv6 addresses). Each address subnet will be used to create a
178 // network. Only if all networks of an interface have no connection, the 186 // network. Only if all networks of an interface have no connection, the
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 // This variable represents the total number of pooled sessions 397 // This variable represents the total number of pooled sessions
390 // both owned by this class and taken by TakePooledSession. 398 // both owned by this class and taken by TakePooledSession.
391 int allocated_pooled_session_count_ = 0; 399 int allocated_pooled_session_count_ = 0;
392 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; 400 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_;
393 bool prune_turn_ports_ = false; 401 bool prune_turn_ports_ = false;
394 }; 402 };
395 403
396 } // namespace cricket 404 } // namespace cricket
397 405
398 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ 406 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698