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

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

Issue 2369963004: Ping the premier connection on each network with higher priority. (Closed)
Patch Set: . 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 7ffa4300893141a2e61ff74ba40ab8c966704a50..cd592b4980d4c193c91cb7cdb7071a406cb2ae5c 100644
--- a/webrtc/p2p/base/p2ptransportchannel.h
+++ b/webrtc/p2p/base/p2ptransportchannel.h
@@ -256,7 +256,7 @@ 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);
+ bool IsPremierConnectionPingable(Connection* conn, int64_t now);
Taylor Brandstetter 2016/10/04 02:08:10 Can you explain in a comment somewhere what's mean
honghaiz3 2016/10/20 23:47:58 Done.
int CalculateActiveWritablePingInterval(const Connection* conn,
int64_t now) const;
void PingConnection(Connection* conn);
@@ -312,12 +312,16 @@ class P2PTransportChannel : public TransportChannelImpl,
// Returns true if the new_connection is selected for transmission.
bool MaybeSwitchSelectedConnection(Connection* new_connection,
const std::string& reason);
-
+ // Updates the premier connection for each network name. This method is
+ // called every time after connections are sorted.
+ void UpdatePremierConnections();
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.
+ Connection* FindBestPremierConnectionToPing(int64_t now);
// Between |conn1| and |conn2|, this function returns the one which should
// be pinged first.
Connection* SelectMostPingableConnection(Connection* conn1,
@@ -370,6 +374,9 @@ class P2PTransportChannel : public TransportChannelImpl,
std::set<Connection*> unpinged_connections_;
Connection* selected_connection_ = nullptr;
+ // The top-ranked connection for each network interface, identified by the
+ // interface name.
+ std::map<std::string, Connection*> premier_connection_by_network_name_;
Taylor Brandstetter 2016/10/04 02:08:10 Can't this be determined algorithmically from conn
honghaiz3 2016/10/20 23:47:58 Done.
std::vector<RemoteCandidate> remote_candidates_;
bool sort_dirty_; // indicates whether another sort is needed right now

Powered by Google App Engine
This is Rietveld 408576698