Index: webrtc/p2p/base/p2ptransportchannel.h |
diff --git a/webrtc/p2p/base/p2ptransportchannel.h b/webrtc/p2p/base/p2ptransportchannel.h |
index 7d5e304bb3318b6cd959e6b6445a0d801f71b462..2d5d42b1901beaa6e7c0ca25669e905da6d57fdf 100644 |
--- a/webrtc/p2p/base/p2ptransportchannel.h |
+++ b/webrtc/p2p/base/p2ptransportchannel.h |
@@ -43,18 +43,6 @@ extern const int STABILIZING_WRITABLE_CONNECTION_PING_INTERVAL; |
extern const int STABLE_WRITABLE_CONNECTION_PING_INTERVAL; |
static const int MIN_PINGS_AT_WEAK_PING_INTERVAL = 3; |
-struct IceParameters { |
- std::string ufrag; |
- std::string pwd; |
- IceParameters(const std::string& ice_ufrag, const std::string& ice_pwd) |
- : ufrag(ice_ufrag), pwd(ice_pwd) {} |
- |
- bool operator==(const IceParameters& other) { |
- return ufrag == other.ufrag && pwd == other.pwd; |
- } |
- bool operator!=(const IceParameters& other) { return !(*this == other); } |
-}; |
- |
// Adds the port on which the candidate originated. |
class RemoteCandidate : public Candidate { |
public: |
@@ -88,10 +76,8 @@ class P2PTransportChannel : public TransportChannelImpl, |
void SetIceRole(IceRole role) override; |
IceRole GetIceRole() const override { return ice_role_; } |
void SetIceTiebreaker(uint64_t tiebreaker) override; |
- void SetIceCredentials(const std::string& ice_ufrag, |
- const std::string& ice_pwd) override; |
- void SetRemoteIceCredentials(const std::string& ice_ufrag, |
- const std::string& ice_pwd) override; |
+ void SetIceParameters(const IceParameters& ice_params) override; |
+ void SetRemoteIceParameters(const IceParameters& ice_params) override; |
void SetRemoteIceMode(IceMode mode) override; |
// TODO(deadbeef): Deprecated. Remove when Chromium's |
// IceTransportChannel does not depend on this. |
@@ -210,8 +196,14 @@ class P2PTransportChannel : public TransportChannelImpl, |
} |
// Public for unit tests. |
- void set_remote_supports_renomination(bool remote_supports_renomination) { |
- remote_supports_renomination_ = remote_supports_renomination; |
+ const IceParameters& ice_parameters() const { return ice_parameters_; } |
+ |
+ // Public for unit tests. |
+ // Returns the latest remote ICE parameters or nullptr if there are no remote |
+ // ICE parameters yet. |
+ IceParameters* remote_ice() { |
+ return remote_ice_parameters_.empty() ? nullptr |
+ : &remote_ice_parameters_.back(); |
} |
Taylor Brandstetter
2016/08/11 22:36:50
I hoped by using SetRemoteIceParameters we could a
honghaiz3
2016/08/12 18:26:40
Done.
|
private: |
@@ -347,12 +339,6 @@ class P2PTransportChannel : public TransportChannelImpl, |
// Compare the last_ping_sent time and return the one least recently pinged. |
Connection* LeastRecentlyPinged(Connection* conn1, Connection* conn2); |
- // Returns the latest remote ICE parameters or nullptr if there are no remote |
- // ICE parameters yet. |
- IceParameters* remote_ice() { |
- return remote_ice_parameters_.empty() ? nullptr |
- : &remote_ice_parameters_.back(); |
- } |
// Returns the remote IceParameters and generation that match |ufrag| |
// if found, and returns nullptr otherwise. |
const IceParameters* FindRemoteIceFromUfrag(const std::string& ufrag, |
@@ -395,8 +381,7 @@ class P2PTransportChannel : public TransportChannelImpl, |
bool had_connection_ = false; // if connections_ has ever been nonempty |
typedef std::map<rtc::Socket::Option, int> OptionMap; |
OptionMap options_; |
- std::string ice_ufrag_; |
- std::string ice_pwd_; |
+ IceParameters ice_parameters_; |
std::vector<IceParameters> remote_ice_parameters_; |
IceMode remote_ice_mode_; |
IceRole ice_role_; |
@@ -410,10 +395,6 @@ class P2PTransportChannel : public TransportChannelImpl, |
IceConfig config_; |
int last_sent_packet_id_ = -1; // -1 indicates no packet was sent before. |
bool started_pinging_ = false; |
- // TODO(honghaiz): Put this and ICE role inside ICEParameters and rename this |
- // as renomination. Set its value in subsequent CLs based on signaling |
- // exchange. |
- bool remote_supports_renomination_ = false; |
// The value put in the "nomination" attribute for the next nominated |
// connection. A zero-value indicates the connection will not be nominated. |
uint32_t nomination_ = 0; |