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, |