Index: webrtc/p2p/base/p2ptransportchannel.h |
diff --git a/webrtc/p2p/base/p2ptransportchannel.h b/webrtc/p2p/base/p2ptransportchannel.h |
index ada3ecfb8bb2deeb6bc5d9120eb1647d7cd1a1da..fadc63bbdcb60adc45779a4436589ed633ae9b1d 100644 |
--- a/webrtc/p2p/base/p2ptransportchannel.h |
+++ b/webrtc/p2p/base/p2ptransportchannel.h |
@@ -102,6 +102,7 @@ class P2PTransportChannel : public TransportChannelImpl, |
// only update the parameter if it is considered set in |config|. For example, |
// a negative value of receiving_timeout will be considered "not set" and we |
// will not use it to update the respective parameter in |config_|. |
+ // TODO(deadbeef): Use rtc::Optional instead of negative values. |
void SetIceConfig(const IceConfig& config) override; |
const IceConfig& config() const; |
@@ -207,6 +208,23 @@ class P2PTransportChannel : public TransportChannelImpl, |
bool weak() const; |
void UpdateConnectionStates(); |
void RequestSort(); |
+ |
+ // Returns an expanded write state based on Connection::write_state and other |
+ // factors. Lower values are preferable. |
+ int MappedWriteState(const cricket::Connection* a) const; |
+ |
+ // 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. |
+ int CompareConnectionStates(const cricket::Connection* a, |
+ const cricket::Connection* b) const; |
+ int CompareConnectionCandidates(const cricket::Connection* a, |
+ const cricket::Connection* b) const; |
+ // Compares first on states, then on candidates, then on RTT. |
+ int CompareConnections(const cricket::Connection* a, |
+ const cricket::Connection* b) const; |
+ |
+ bool ShouldSwitch(const cricket::Connection* a, |
+ const cricket::Connection* b) const; |
void SortConnections(); |
void SwitchBestConnectionTo(Connection* conn); |
void UpdateState(); |