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..3d9a515cff2bf342cd578c70fba4a30a181cacb3 100644 |
| --- a/webrtc/p2p/base/p2ptransportchannel.h |
| +++ b/webrtc/p2p/base/p2ptransportchannel.h |
| @@ -36,6 +36,15 @@ namespace cricket { |
| extern const uint32_t WEAK_PING_DELAY; |
| +struct IceGeneration { |
|
pthatcher1
2015/12/10 22:08:06
Now that I see the code, I see that it gets confus
honghaiz3
2015/12/11 04:47:29
Done.
|
| + std::string ufrag; |
| + std::string pwd; |
| + IceGeneration(const std::string& ice_ufrag, const std::string& ice_pwd) { |
|
pthatcher1
2015/12/10 22:08:06
Could be:
IceGenration(const std::string& ufrag,
honghaiz3
2015/12/11 04:47:29
Done.
|
| + ufrag = ice_ufrag; |
| + pwd = ice_pwd; |
| + } |
| +}; |
| + |
| // Adds the port on which the candidate originated. |
| class RemoteCandidate : public Candidate { |
| public: |
| @@ -229,6 +238,21 @@ class P2PTransportChannel : public TransportChannelImpl, |
| Connection* best_nominated_connection() const; |
| bool IsBackupConnection(Connection* conn) const; |
| + // Makes sure |remote_ice_generations_| is not empty before calling this. |
| + std::string& remote_ice_ufrag() { |
| + ASSERT(!remote_ice_generations_.empty()); |
| + return remote_ice_generations_.back().ufrag; |
| + } |
| + // Makes sure |remote_ice_generations_| is not empty before calling this. |
| + std::string& remote_ice_pwd() { |
| + ASSERT(!remote_ice_generations_.empty()); |
| + return remote_ice_generations_.back().pwd; |
| + } |
|
pthatcher1
2015/12/10 22:08:06
I think it would be better to have a remote_ice()
honghaiz3
2015/12/11 04:47:29
Done.
|
| + int remote_ice_generation() { |
| + // When |remote_ice_generations_| has one element, it is generation 0. |
| + return remote_ice_generations_.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<IceGeneration> remote_ice_generations_; |
|
pthatcher1
2015/12/10 22:08:06
And remote_ice_parameters_ might make sense here.
honghaiz3
2015/12/11 04:47:29
Done.
|
| IceMode remote_ice_mode_; |
| IceRole ice_role_; |
| uint64_t tiebreaker_; |
| - uint32_t remote_candidate_generation_; |
| IceGatheringState gathering_state_; |
| int check_receiving_delay_; |