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

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

Issue 2063823008: Adding IceConfig option to assume TURN/TURN candidate pairs will work. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Responding to comments. Doing "presumed writable" determination in Connection. Created 4 years, 6 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 ada3ecfb8bb2deeb6bc5d9120eb1647d7cd1a1da..927bf7918228a94f0e11271fca4c309a9e03e9ec 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,19 @@ class P2PTransportChannel : public TransportChannelImpl,
bool weak() const;
void UpdateConnectionStates();
void RequestSort();
+
+ // 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 ShouldSwitchSelectedConnection(const cricket::Connection* selected,
+ const cricket::Connection* conn) const;
void SortConnections();
void SwitchBestConnectionTo(Connection* conn);
void UpdateState();

Powered by Google App Engine
This is Rietveld 408576698