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

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

Issue 1668073002: Add network cost as part of the connection comparison. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 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 436b1e7faafc2993f67e5905a35ef0e56f1f2cf2..3594edbaaa8a6cbe7d0caa02c2b04a8ca5198082 100644
--- a/webrtc/p2p/base/port.h
+++ b/webrtc/p2p/base/port.h
@@ -296,6 +296,7 @@ class Port : public PortInterface, public rtc::MessageHandler,
void set_candidate_filter(uint32_t candidate_filter) {
candidate_filter_ = candidate_filter;
}
+ int32_t network_cost() const { return network_cost_; }
protected:
enum {
@@ -395,6 +396,10 @@ class Port : public PortInterface, public rtc::MessageHandler,
// TurnPort will hide raddr to avoid local address leakage.
uint32_t candidate_filter_;
+ // A virtual cost perceived by the user based on the network type. It is
pthatcher1 2016/02/04 23:16:21 You should say, usually according to network type
honghaiz3 2016/02/05 01:36:46 Done.
+ // used to determine the rank of connections.
pthatcher1 2016/02/04 23:16:21 Instead of talking about rank, just say that cost
honghaiz3 2016/02/05 01:36:46 Done.
+ uint32_t network_cost_;
+
friend class Connection;
};
@@ -560,6 +565,8 @@ class Connection : public rtc::MessageHandler,
IceMode remote_ice_mode() const { return remote_ice_mode_; }
+ int ComputeNetworkCost() const;
+
// Update the ICE password of the remote candidate if |ice_ufrag| matches
// the candidate's ufrag, and the candidate's passwrod has not been set.
void MaybeSetRemoteIceCredentials(const std::string& ice_ufrag,

Powered by Google App Engine
This is Rietveld 408576698