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

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

Issue 2369963004: Ping the premier connection on each network with higher priority. (Closed)
Patch Set: Add TODO for re-thinking prioritizing connections for ping requests. Created 4 years, 2 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/p2ptransportchannel.h
diff --git a/webrtc/p2p/base/p2ptransportchannel.h b/webrtc/p2p/base/p2ptransportchannel.h
index 672abb7423b95f1904428c0a8873d4e6c6262c32..637708262c7cd9b701f43693699cad98d1714c3d 100644
--- a/webrtc/p2p/base/p2ptransportchannel.h
+++ b/webrtc/p2p/base/p2ptransportchannel.h
@@ -43,8 +43,8 @@ namespace cricket {
enum class IceRestartState { CONNECTING, CONNECTED, DISCONNECTED, MAX_VALUE };
extern const int WEAK_PING_INTERVAL;
-extern const int STABILIZING_WRITABLE_CONNECTION_PING_INTERVAL;
-extern const int STABLE_WRITABLE_CONNECTION_PING_INTERVAL;
+extern const int WEAK_OR_STABILIZING_WRITABLE_CONNECTION_PING_INTERVAL;
+extern const int STRONG_AND_STABLE_WRITABLE_CONNECTION_PING_INTERVAL;
static const int MIN_PINGS_AT_WEAK_PING_INTERVAL = 3;
// Adds the port on which the candidate originated.
@@ -261,7 +261,9 @@ class P2PTransportChannel : public TransportChannelImpl,
void RememberRemoteCandidate(const Candidate& remote_candidate,
PortInterface* origin_port);
bool IsPingable(const Connection* conn, int64_t now) const;
- bool IsSelectedConnectionPingable(int64_t now);
+ // Whether a premier connection is pingable, where a premier connection is
+ // the top-ranked connection on each network.
+ bool IsPremierConnectionPingable(Connection* premier_conn, int64_t now);
int CalculateActiveWritablePingInterval(const Connection* conn,
int64_t now) const;
void PingConnection(Connection* conn);
@@ -317,12 +319,15 @@ class P2PTransportChannel : public TransportChannelImpl,
// Returns true if the new_connection is selected for transmission.
bool MaybeSwitchSelectedConnection(Connection* new_connection,
const std::string& reason);
-
+ // Gets all premier connections on all networks.
+ std::map<rtc::Network*, Connection*> GetPremierConnectionsByNetwork() const;
void PruneConnections();
bool IsBackupConnection(const Connection* conn) const;
Connection* FindConnectionToPing(int64_t now);
Connection* FindOldestConnectionNeedingTriggeredCheck(int64_t now);
+ // Finds the best premier connection for pinging.
pthatcher1 2016/10/24 20:49:05 I find this confusing since "best" and "premier" a
honghaiz3 2016/10/24 23:35:09 Removed this method base on another suggestion.
+ Connection* FindBestPremierConnectionToPing(int64_t now);
// Between |conn1| and |conn2|, this function returns the one which should
// be pinged first.
Connection* SelectMostPingableConnection(Connection* conn1,

Powered by Google App Engine
This is Rietveld 408576698