Chromium Code Reviews| Index: webrtc/p2p/base/p2ptransportchannel.h |
| diff --git a/webrtc/p2p/base/p2ptransportchannel.h b/webrtc/p2p/base/p2ptransportchannel.h |
| index 2b02d36a61ab899d3dc462982ac4d39f35faea41..e844df9b2b2d9c674647700052ebae5a0db5335a 100644 |
| --- a/webrtc/p2p/base/p2ptransportchannel.h |
| +++ b/webrtc/p2p/base/p2ptransportchannel.h |
| @@ -36,6 +36,19 @@ namespace cricket { |
| extern const uint32_t WEAK_PING_DELAY; |
| +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) { |
|
pthatcher1
2015/12/16 19:47:26
I think this can be
return !(this == other);
honghaiz3
2015/12/16 22:26:38
Done.
|
| + return ufrag != other.ufrag || pwd != other.pwd; |
| + } |
| + bool operator==(const IceParameters& other) { |
| + return ufrag == other.ufrag && pwd == other.pwd; |
| + } |
| +}; |
| + |
| // Adds the port on which the candidate originated. |
| class RemoteCandidate : public Candidate { |
| public: |
| @@ -229,6 +242,19 @@ class P2PTransportChannel : public TransportChannelImpl, |
| Connection* best_nominated_connection() const; |
| bool IsBackupConnection(Connection* conn) const; |
| + // Returns the latest remote ICE parameters |
|
pthatcher1
2015/12/16 19:47:26
or nullptr if there are no remote ICE parameters y
honghaiz3
2015/12/16 22:26:38
Done.
|
| + IceParameters* remote_ice() { |
| + return remote_ice_parameters_.empty() ? nullptr |
| + : &remote_ice_parameters_.back(); |
| + } |
| + // Returns the index of the latest remote ICE parameters, or 0 if no remote |
| + // ICE parameters have been received. |
| + uint32_t remote_ice_generation() { |
| + return remote_ice_parameters_.empty() |
| + ? 0 |
| + : static_cast<uint32_t>(remote_ice_parameters_.size() - 1); |
| + } |
| + |
| P2PTransport* transport_; |
| PortAllocator* allocator_; |
| rtc::Thread* worker_thread_; |
| @@ -248,12 +274,10 @@ class P2PTransportChannel : public TransportChannelImpl, |
| OptionMap options_; |
| std::string ice_ufrag_; |
| std::string ice_pwd_; |
| - std::string remote_ice_ufrag_; |
| - std::string remote_ice_pwd_; |
| + std::vector<IceParameters> remote_ice_parameters_; |
| IceMode remote_ice_mode_; |
| IceRole ice_role_; |
| uint64_t tiebreaker_; |
| - uint32_t remote_candidate_generation_; |
| IceGatheringState gathering_state_; |
| int check_receiving_delay_; |