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

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

Issue 2143653005: Dampening connection switch. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: . 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
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel_unittest.cc ('k') | webrtc/p2p/base/port.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/port.h
diff --git a/webrtc/p2p/base/port.h b/webrtc/p2p/base/port.h
index 2c3b61b718307173d152a1c8f35ecf933b00aaed..37926c955603a3f27918270b5b43b177cdccddf9 100644
--- a/webrtc/p2p/base/port.h
+++ b/webrtc/p2p/base/port.h
@@ -590,6 +590,10 @@ 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 last time when the connection changed its receiving state.
+ int64_t receiving_unchanged_since() const {
+ return receiving_unchanged_since_;
+ }
bool stable(int64_t now) const;
@@ -618,7 +622,7 @@ class Connection : public CandidatePairInterface,
// Changes the state and signals if necessary.
void set_write_state(WriteState value);
- void set_receiving(bool value);
+ void UpdateReceiving(int64_t now);
void set_state(State state);
void set_connected(bool value);
@@ -648,6 +652,7 @@ class Connection : public CandidatePairInterface,
// side
int64_t last_data_received_;
int64_t last_ping_response_received_;
+ int64_t receiving_unchanged_since_ = 0;
std::vector<SentPing> pings_since_last_response_;
rtc::RateTracker recv_rate_tracker_;
« no previous file with comments | « webrtc/p2p/base/p2ptransportchannel_unittest.cc ('k') | webrtc/p2p/base/port.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698