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

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

Issue 2171183002: Remove ports that are not used by any channel after timeout (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: . Created 4 years, 4 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
« no previous file with comments | « webrtc/p2p/base/port_unittest.cc ('k') | webrtc/p2p/client/basicportallocator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 // TODO(honghaiz): Implement this in BasicPortAllocator. 182 // TODO(honghaiz): Implement this in BasicPortAllocator.
183 virtual void RegatherOnAllNetworks() {} 183 virtual void RegatherOnAllNetworks() {}
184 184
185 // Another way of getting the information provided by the signals below. 185 // Another way of getting the information provided by the signals below.
186 // 186 //
187 // Ports and candidates are not guaranteed to be in the same order as the 187 // Ports and candidates are not guaranteed to be in the same order as the
188 // signals were emitted in. 188 // signals were emitted in.
189 virtual std::vector<PortInterface*> ReadyPorts() const = 0; 189 virtual std::vector<PortInterface*> ReadyPorts() const = 0;
190 virtual std::vector<Candidate> ReadyCandidates() const = 0; 190 virtual std::vector<Candidate> ReadyCandidates() const = 0;
191 virtual bool CandidatesAllocationDone() const = 0; 191 virtual bool CandidatesAllocationDone() const = 0;
192 // Marks all ports in the current session as "pruned" so that they may be
193 // destroyed if no connection is using them.
194 virtual void PruneAllPorts() {}
192 195
193 sigslot::signal2<PortAllocatorSession*, PortInterface*> SignalPortReady; 196 sigslot::signal2<PortAllocatorSession*, PortInterface*> SignalPortReady;
194 // Fires this signal when the network of the ports failed (either because the 197 // Fires this signal when the network of the ports failed (either because the
195 // interface is down, or because there is no connection on the interface), 198 // interface is down, or because there is no connection on the interface),
196 // or when TURN ports are pruned because a higher-priority TURN port becomes 199 // or when TURN ports are pruned because a higher-priority TURN port becomes
197 // ready(pairable). 200 // ready(pairable).
198 sigslot::signal2<PortAllocatorSession*, const std::vector<PortInterface*>&> 201 sigslot::signal2<PortAllocatorSession*, const std::vector<PortInterface*>&>
199 SignalPortsPruned; 202 SignalPortsPruned;
200 sigslot::signal2<PortAllocatorSession*, 203 sigslot::signal2<PortAllocatorSession*,
201 const std::vector<Candidate>&> SignalCandidatesReady; 204 const std::vector<Candidate>&> SignalCandidatesReady;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 // This variable represents the total number of pooled sessions 388 // This variable represents the total number of pooled sessions
386 // both owned by this class and taken by TakePooledSession. 389 // both owned by this class and taken by TakePooledSession.
387 int allocated_pooled_session_count_ = 0; 390 int allocated_pooled_session_count_ = 0;
388 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; 391 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_;
389 bool prune_turn_ports_ = false; 392 bool prune_turn_ports_ = false;
390 }; 393 };
391 394
392 } // namespace cricket 395 } // namespace cricket
393 396
394 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ 397 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_
OLDNEW
« no previous file with comments | « webrtc/p2p/base/port_unittest.cc ('k') | webrtc/p2p/client/basicportallocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698