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

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

Issue 2143653005: Dampening connection switch. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Address comments 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..190a374ce62f00c1a3a14910e75d79369cc8fc28 100644
--- a/webrtc/p2p/base/port.h
+++ b/webrtc/p2p/base/port.h
@@ -590,6 +590,17 @@ 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 time since which the connection has been in receiving
+ // state.
pthatcher1 2016/07/14 18:01:44 I think it should be more like the time at which w
honghaiz3 2016/07/14 23:15:01 Done.
+ int64_t continuously_receiving_since() const {
+ return continuously_receiving_since_;
+ }
+
+ void reset_continuously_receiving_since(int64_t now) {
+ if (continuously_receiving_since_ > 0) {
+ continuously_receiving_since_ = now;
+ }
+ }
bool stable(int64_t now) const;
@@ -618,7 +629,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 +659,7 @@ class Connection : public CandidatePairInterface,
// side
int64_t last_data_received_;
int64_t last_ping_response_received_;
+ int64_t continuously_receiving_since_ = 0;
pthatcher1 2016/07/14 18:01:44 Well, that makes it sounds like we've been continu
honghaiz3 2016/07/14 23:15:01 As I said, the value should not be used at all if
std::vector<SentPing> pings_since_last_response_;
rtc::RateTracker recv_rate_tracker_;

Powered by Google App Engine
This is Rietveld 408576698