Index: webrtc/p2p/base/p2ptransportchannel.cc |
diff --git a/webrtc/p2p/base/p2ptransportchannel.cc b/webrtc/p2p/base/p2ptransportchannel.cc |
index fc721312331233ad7db90f42164913fd5606bbb3..5a26d7c6c95bb5e40efa8e45892a2be629a56037 100644 |
--- a/webrtc/p2p/base/p2ptransportchannel.cc |
+++ b/webrtc/p2p/base/p2ptransportchannel.cc |
@@ -19,6 +19,7 @@ |
#include "webrtc/base/crc32.h" |
#include "webrtc/base/logging.h" |
#include "webrtc/base/stringencode.h" |
+#include "webrtc/system_wrappers/interface/field_trial.h" |
namespace { |
@@ -220,7 +221,12 @@ P2PTransportChannel::P2PTransportChannel(const std::string& transport_name, |
remote_candidate_generation_(0), |
gathering_state_(kIceGatheringNew), |
check_receiving_delay_(MIN_CHECK_RECEIVING_DELAY * 5), |
- receiving_timeout_(MIN_CHECK_RECEIVING_DELAY * 50) {} |
+ receiving_timeout_(MIN_CHECK_RECEIVING_DELAY * 50) { |
+ uint32_t weak_ping_delay = ::strtoul( |
+ webrtc::field_trial::FindFullName("WebRTC-WeakPingDelay").c_str(), |
pthatcher1
2015/10/16 21:30:31
While we call it "weak ping delay" internally, the
|
+ nullptr, 10); |
+ weak_ping_delay_ = weak_ping_delay ? weak_ping_delay : WEAK_PING_DELAY; |
pthatcher1
2015/10/16 21:30:31
I think this would be more readable as:
if (weak_
|
+} |
P2PTransportChannel::~P2PTransportChannel() { |
ASSERT(worker_thread_ == rtc::Thread::Current()); |
@@ -1156,7 +1162,7 @@ void P2PTransportChannel::OnCheckAndPing() { |
UpdateConnectionStates(); |
// When the best connection is either not receiving or not writable, |
// switch to weak ping delay. |
- int ping_delay = weak() ? WEAK_PING_DELAY : STRONG_PING_DELAY; |
+ int ping_delay = weak() ? weak_ping_delay_ : STRONG_PING_DELAY; |
if (rtc::Time() >= last_ping_sent_ms_ + ping_delay) { |
Connection* conn = FindNextPingableConnection(); |
if (conn) { |