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..5c7d33cd452b20456ce51c44eecfff50c9fc507e 100644 |
| --- a/webrtc/p2p/base/p2ptransportchannel.h |
| +++ b/webrtc/p2p/base/p2ptransportchannel.h |
| @@ -30,12 +30,24 @@ |
| #include "webrtc/p2p/base/transport.h" |
| #include "webrtc/p2p/base/transportchannelimpl.h" |
| #include "webrtc/base/asyncpacketsocket.h" |
| +#include "webrtc/base/optional.h" |
| #include "webrtc/base/sigslot.h" |
| namespace cricket { |
| extern const uint32_t WEAK_PING_DELAY; |
| +struct IceParameter { |
|
pthatcher1
2015/12/12 00:30:34
IceParameters
(with an "s")
Yes, I know that mak
honghaiz3
2015/12/14 18:40:19
Done.
|
| + std::string ufrag; |
| + std::string pwd; |
| + IceParameter(const std::string& ice_ufrag, const std::string& ice_pwd) |
| + : ufrag(ice_ufrag), pwd(ice_pwd) {} |
| + IceParameter() : ufrag(""), pwd("") {} |
| + bool operator!=(const IceParameter& other) { |
|
pthatcher1
2015/12/12 00:30:34
Can you implement both == and != just to make sure
honghaiz3
2015/12/14 18:40:19
Done.
|
| + return ufrag != other.ufrag || pwd != other.pwd; |
| + } |
| +}; |
| + |
| // Adds the port on which the candidate originated. |
| class RemoteCandidate : public Candidate { |
| public: |
| @@ -229,6 +241,18 @@ class P2PTransportChannel : public TransportChannelImpl, |
| Connection* best_nominated_connection() const; |
| bool IsBackupConnection(Connection* conn) const; |
| + rtc::Optional<IceParameter> remote_ice() { |
|
pthatcher1
2015/12/12 00:30:34
Can you leave a comment saying it's the latest rem
honghaiz3
2015/12/14 18:40:19
Done.
|
| + return remote_ice_parameters_.empty() |
| + ? rtc::Optional<IceParameter>() |
| + : rtc::Optional<IceParameter>(remote_ice_parameters_.back()); |
| + } |
|
pthatcher1
2015/12/12 00:30:34
If it's too much of a problem to avoid copying wit
honghaiz3
2015/12/14 18:40:19
Done.
|
| + uint32_t remote_ice_generation() { |
|
pthatcher1
2015/12/12 00:30:34
Can you leave a comment saying it's the index of t
honghaiz3
2015/12/14 18:40:19
Done.
|
| + // When |remote_ice_parameters_| has one element, it is generation 0. |
| + 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 +272,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<IceParameter> 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_; |