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

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

Issue 1498993002: Add ufrag to the ICE candidate signaling. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years 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
« no previous file with comments | « talk/app/webrtc/webrtcsdp_unittest.cc ('k') | webrtc/p2p/base/p2ptransportchannel.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/p2ptransportchannel.h
diff --git a/webrtc/p2p/base/p2ptransportchannel.h b/webrtc/p2p/base/p2ptransportchannel.h
index 2b02d36a61ab899d3dc462982ac4d39f35faea41..92c0534e7c4edba195586ecd412a49a7b2298850 100644
--- a/webrtc/p2p/base/p2ptransportchannel.h
+++ b/webrtc/p2p/base/p2ptransportchannel.h
@@ -36,6 +36,18 @@ 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) {
+ 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:
@@ -229,6 +241,20 @@ class P2PTransportChannel : public TransportChannelImpl,
Connection* best_nominated_connection() const;
bool IsBackupConnection(Connection* conn) const;
+ // 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 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_;
« no previous file with comments | « talk/app/webrtc/webrtcsdp_unittest.cc ('k') | webrtc/p2p/base/p2ptransportchannel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698