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

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

Issue 2069493002: Do not switch best connection on the controlled side too frequently (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Updates a comment Created 4 years, 6 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 06efd2d3c235c4e976fda6f610c187741ac7542f..dfde2157e8af66e142f92872693bb586a58c7097 100644
--- a/webrtc/p2p/base/port.h
+++ b/webrtc/p2p/base/port.h
@@ -178,7 +178,7 @@ class Port : public PortInterface, public rtc::MessageHandler,
}
// Identifies the generation that this port was created in.
- uint32_t generation() { return generation_; }
+ uint32_t generation() const { return generation_; }
void set_generation(uint32_t generation) { generation_ = generation; }
const std::string username_fragment() const;
@@ -502,6 +502,13 @@ class Connection : public CandidatePairInterface,
// side stops using it as well.
bool pruned() const { return pruned_; }
void Prune();
+ // Called when the state is WRITE_TIMEOUT but need to be reset and un-pruned.
+ void ResetWriteStateAndUnprune() {
+ write_state_ = STATE_WRITE_INIT;
+ if (pruned_) {
+ pruned_ = false;
+ }
+ }
bool use_candidate_attr() const { return use_candidate_attr_; }
void set_use_candidate_attr(bool enable);
@@ -542,6 +549,8 @@ class Connection : public CandidatePairInterface,
// Handles the binding request; sends a response if this is a valid request.
void HandleBindingRequest(IceMessage* msg);
+ int64_t last_data_received() const { return last_data_received_; }
+
// Debugging description of this connection
std::string ToDebugId() const;
std::string ToString() const;

Powered by Google App Engine
This is Rietveld 408576698