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

Unified Diff: webrtc/p2p/base/p2ptransportchannel.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
« no previous file with comments | « no previous file | webrtc/p2p/base/p2ptransportchannel.cc » ('j') | webrtc/p2p/base/p2ptransportchannel.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/p2ptransportchannel.h
diff --git a/webrtc/p2p/base/p2ptransportchannel.h b/webrtc/p2p/base/p2ptransportchannel.h
index 14cda683f5bf499358c0d77cf7220464e9553745..4a414ef1bbb1d0b071094dabbf78288e998a3dbc 100644
--- a/webrtc/p2p/base/p2ptransportchannel.h
+++ b/webrtc/p2p/base/p2ptransportchannel.h
@@ -208,7 +208,7 @@ class P2PTransportChannel : public TransportChannelImpl,
}
private:
- rtc::Thread* thread() { return worker_thread_; }
+ rtc::Thread* thread() const { return worker_thread_; }
bool IsGettingPorts() { return allocator_session()->IsGettingPorts(); }
// A transport channel is weak if the current best connection is either
@@ -222,10 +222,16 @@ class P2PTransportChannel : public TransportChannelImpl,
// that's pingable.
void MaybeStartPinging();
- // The methods below return a positive value if a is preferable to b,
- // a negative value if b is preferable, and 0 if they're equally preferable.
+ // The methods below return a positive value if |a| is preferable to |b|,
+ // a negative value if |b| is preferable, and 0 if they're equally preferable.
+ // If |b_receiving_threshold| is not zero, then when |b| is receiving and |a|
+ // is not, returns a negative value only if the current time is at least
+ // |b_receiving_threshold| milliseconds. If the current time is less than
+ // that, sets |switching_dampened| to be true.
pthatcher1 2016/07/14 18:01:44 to be true => to true Also, "switching_dampened"
honghaiz3 2016/07/14 23:15:01 Done.
int CompareConnectionStates(const cricket::Connection* a,
- const cricket::Connection* b) const;
+ const cricket::Connection* b,
+ int64_t b_receiving_threshold,
+ bool* switching_dampened) const;
int CompareConnectionCandidates(const cricket::Connection* a,
const cricket::Connection* b) const;
// Compares two connections based on the connection states
@@ -234,12 +240,12 @@ class P2PTransportChannel : public TransportChannelImpl,
// and ShouldSwitchSelectedConnection().
// Returns a positive value if |a| is better than |b|.
int CompareConnections(const cricket::Connection* a,
- const cricket::Connection* b) const;
+ const cricket::Connection* b,
+ int64_t b_receiving_threshold,
+ bool* switching_dampened) const;
bool PresumedWritable(const cricket::Connection* conn) const;
- bool ShouldSwitchSelectedConnection(const cricket::Connection* selected,
- const cricket::Connection* conn) const;
void SortConnectionsAndUpdateState();
void SwitchSelectedConnection(Connection* conn);
void UpdateState();
@@ -307,7 +313,7 @@ class P2PTransportChannel : public TransportChannelImpl,
void OnRegatherOnFailedNetworks();
// Returns true if the new_connection should be selected for transmission.
- bool ShouldSwitchSelectedConnection(Connection* new_connection) const;
+ bool ShouldSwitchSelectedConnection(Connection* new_connection);
void PruneConnections();
bool IsBackupConnection(const Connection* conn) const;
@@ -387,6 +393,7 @@ class P2PTransportChannel : public TransportChannelImpl,
IceConfig config_;
int last_sent_packet_id_ = -1; // -1 indicates no packet was sent before.
bool started_pinging_ = false;
+ bool was_strong_ = false;
RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel);
};
« no previous file with comments | « no previous file | webrtc/p2p/base/p2ptransportchannel.cc » ('j') | webrtc/p2p/base/p2ptransportchannel.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698