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

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

Issue 2224563004: Add signaling to support ICE renomination. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Merge Created 4 years, 4 months 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 | « webrtc/p2p/base/transportchannelimpl.h ('k') | webrtc/p2p/base/transportdescriptionfactory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/transportdescription.h
diff --git a/webrtc/p2p/base/transportdescription.h b/webrtc/p2p/base/transportdescription.h
index 42e45a670f9f415331466e76d1742b67f54d64b9..df8ee92003ef88af0b0d1f76de0a7256517e0781 100644
--- a/webrtc/p2p/base/transportdescription.h
+++ b/webrtc/p2p/base/transportdescription.h
@@ -60,11 +60,33 @@ enum ConnectionRole {
CONNECTIONROLE_HOLDCONN,
};
+struct IceParameters {
+ // TODO(honghaiz): Include ICE mode in this structure to match the ORTC
+ // struct:
+ // http://ortc.org/wp-content/uploads/2016/03/ortc.html#idl-def-RTCIceParameters
+ std::string ufrag;
+ std::string pwd;
+ bool renomination = false;
+ IceParameters() = default;
+ IceParameters(const std::string& ice_ufrag,
+ const std::string& ice_pwd,
+ bool ice_renomination)
+ : ufrag(ice_ufrag), pwd(ice_pwd), renomination(ice_renomination) {}
+
+ bool operator==(const IceParameters& other) {
+ return ufrag == other.ufrag && pwd == other.pwd &&
+ renomination == other.renomination;
+ }
+ bool operator!=(const IceParameters& other) { return !(*this == other); }
+};
+
extern const char CONNECTIONROLE_ACTIVE_STR[];
extern const char CONNECTIONROLE_PASSIVE_STR[];
extern const char CONNECTIONROLE_ACTPASS_STR[];
extern const char CONNECTIONROLE_HOLDCONN_STR[];
+constexpr auto ICE_RENOMINATION_STR = "renomination";
+
bool StringToConnectionRole(const std::string& role_str, ConnectionRole* role);
bool ConnectionRoleToString(const ConnectionRole& role, std::string* role_str);
@@ -125,6 +147,10 @@ struct TransportDescription {
}
bool secure() const { return identity_fingerprint != NULL; }
+ IceParameters GetIceParameters() {
+ return IceParameters(ice_ufrag, ice_pwd, HasOption(ICE_RENOMINATION_STR));
+ }
+
static rtc::SSLFingerprint* CopyFingerprint(
const rtc::SSLFingerprint* from) {
if (!from)
« no previous file with comments | « webrtc/p2p/base/transportchannelimpl.h ('k') | webrtc/p2p/base/transportdescriptionfactory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698