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

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

Issue 2143653005: Dampening connection switch. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Add tests and fix an issue Created 4 years, 5 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/port.h
diff --git a/webrtc/p2p/base/port.h b/webrtc/p2p/base/port.h
index 2c3b61b718307173d152a1c8f35ecf933b00aaed..9a91e402f2c11bb3a5a348a403bdb74e12c6c3be 100644
--- a/webrtc/p2p/base/port.h
+++ b/webrtc/p2p/base/port.h
@@ -568,6 +568,7 @@ class Connection : public CandidatePairInterface,
State state() const { return state_; }
int num_pings_sent() const { return num_pings_sent_; }
+ void reset_num_pings_sent() { num_pings_sent_ = 0; }
IceMode remote_ice_mode() const { return remote_ice_mode_; }
@@ -590,6 +591,15 @@ class Connection : public CandidatePairInterface,
// Returns the last received time of any data, stun request, or stun
// response in milliseconds
int64_t last_received() const;
+ // Returns the first received time of any packet since the last time the
+ // transport channel is weak.
pthatcher1 2016/07/13 21:17:22 is weak => was weakly connected
honghaiz3 2016/07/14 04:54:20 Method removed and replaced.
+ int64_t first_received_since_channel_weak() const {
+ return first_received_since_channel_weak_;
+ }
+
+ void reset_first_received_since_channel_weak() {
+ first_received_since_channel_weak_ = 0;
+ }
bool stable(int64_t now) const;
@@ -648,6 +658,7 @@ class Connection : public CandidatePairInterface,
// side
int64_t last_data_received_;
int64_t last_ping_response_received_;
+ int64_t first_received_since_channel_weak_ = 0;
std::vector<SentPing> pings_since_last_response_;
rtc::RateTracker recv_rate_tracker_;

Powered by Google App Engine
This is Rietveld 408576698