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

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

Issue 2093623004: Add config to prune TURN ports (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Partially disable the test TestEachInterfaceHasItsOwnTurnPorts Created 4 years, 6 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/port_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 6a32b9668f882ddc245f4f2af9bc3683ced930a4..9b4465d3de816b522bb93d55130e8e1d61bf9253 100644
--- a/webrtc/p2p/base/portallocator.h
+++ b/webrtc/p2p/base/portallocator.h
@@ -178,6 +178,11 @@ class PortAllocatorSession : public sigslot::has_slots<> {
sigslot::signal2<PortAllocatorSession*,
const std::vector<Candidate>&> SignalCandidatesReady;
sigslot::signal1<PortAllocatorSession*> SignalCandidatesAllocationDone;
+ // A TURN port is pruned if a higher-priority TURN port becomes ready
+ // (pairable). When it is pruned, it will not be used for creating
+ // connections and its candidates will not be sent to the remote side
+ // if they have not been sent.
+ sigslot::signal2<PortAllocatorSession*, PortInterface*> SignalPortPruned;
virtual uint32_t generation() { return generation_; }
virtual void set_generation(uint32_t generation) { generation_ = generation; }
@@ -253,7 +258,8 @@ class PortAllocator : public sigslot::has_slots<> {
// pooled sessions will be either created or destroyed as necessary.
void SetConfiguration(const ServerAddresses& stun_servers,
const std::vector<RelayServerConfig>& turn_servers,
- int candidate_pool_size);
+ int candidate_pool_size,
+ bool prune_turn_ports);
const ServerAddresses& stun_servers() const { return stun_servers_; }
@@ -327,6 +333,8 @@ class PortAllocator : public sigslot::has_slots<> {
candidate_filter_ = filter;
}
+ bool prune_turn_ports() const { return prune_turn_ports_; }
+
// Gets/Sets the Origin value used for WebRTC STUN requests.
const std::string& origin() const { return origin_; }
void set_origin(const std::string& origin) { origin_ = origin; }
@@ -357,6 +365,7 @@ class PortAllocator : public sigslot::has_slots<> {
// both owned by this class and taken by TakePooledSession.
int allocated_pooled_session_count_ = 0;
std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_;
+ bool prune_turn_ports_ = false;
};
} // namespace cricket
« no previous file with comments | « webrtc/p2p/base/port_unittest.cc ('k') | webrtc/p2p/base/portallocator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698