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

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

Issue 2670053002: Allow applications to limit the ICE check rate through RTCConfiguration (Closed)
Patch Set: CR feedback Created 3 years, 11 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/jseptransport.h ('k') | webrtc/p2p/base/p2ptransportchannel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/p2ptransportchannel.h
diff --git a/webrtc/p2p/base/p2ptransportchannel.h b/webrtc/p2p/base/p2ptransportchannel.h
index 2327b2d4771b776e3086fc484e12841257e6160f..268a7a079489dfccc0717334bfc7eb5e25580edd 100644
--- a/webrtc/p2p/base/p2ptransportchannel.h
+++ b/webrtc/p2p/base/p2ptransportchannel.h
@@ -42,6 +42,7 @@ namespace cricket {
enum class IceRestartState { CONNECTING, CONNECTED, DISCONNECTED, MAX_VALUE };
extern const int WEAK_PING_INTERVAL;
+extern const int STRONG_PING_INTERVAL;
extern const int WEAK_OR_STABILIZING_WRITABLE_CONNECTION_PING_INTERVAL;
extern const int STRONG_AND_STABLE_WRITABLE_CONNECTION_PING_INTERVAL;
static const int MIN_PINGS_AT_WEAK_PING_INTERVAL = 3;
@@ -162,6 +163,23 @@ class P2PTransportChannel : public IceTransportInternal,
// A transport channel is weak if the current best connection is either
// not receiving or not writable, or if there is no best connection at all.
bool weak() const;
+
+ int weak_ping_interval() const {
+ if (config_.ice_check_min_interval &&
+ weak_ping_interval_ < *config_.ice_check_min_interval) {
+ return *config_.ice_check_min_interval;
+ }
+ return weak_ping_interval_;
+ }
+
+ int strong_ping_interval() const {
+ if (config_.ice_check_min_interval &&
+ STRONG_PING_INTERVAL < *config_.ice_check_min_interval) {
+ return *config_.ice_check_min_interval;
+ }
+ return STRONG_PING_INTERVAL;
+ }
+
// Returns true if it's possible to send packets on |connection|.
bool ReadyToSend(Connection* connection) const;
void UpdateConnectionStates();
« no previous file with comments | « webrtc/p2p/base/jseptransport.h ('k') | webrtc/p2p/base/p2ptransportchannel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698