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

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: Merge branch 'master' into turn_port_exposer 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
Index: webrtc/p2p/base/portallocator.h
diff --git a/webrtc/p2p/base/portallocator.h b/webrtc/p2p/base/portallocator.h
index 6a32b9668f882ddc245f4f2af9bc3683ced930a4..f5328addf603f68c7548a222530f850f75bc9a44 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 there is a higher-priority TURN port becomes
pthatcher1 2016/06/28 21:01:41 if there is a => if a
honghaiz3 2016/06/28 23:35:59 Done.
+ // 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_;
};
} // namespace cricket

Powered by Google App Engine
This is Rietveld 408576698