Chromium Code Reviews| Index: webrtc/p2p/base/transportdescription.h |
| diff --git a/webrtc/p2p/base/transportdescription.h b/webrtc/p2p/base/transportdescription.h |
| index 42e45a670f9f415331466e76d1742b67f54d64b9..54c20b3a5028a8fa6bfc802f6bad645959edf108 100644 |
| --- a/webrtc/p2p/base/transportdescription.h |
| +++ b/webrtc/p2p/base/transportdescription.h |
| @@ -60,11 +60,30 @@ enum ConnectionRole { |
| CONNECTIONROLE_HOLDCONN, |
| }; |
| +struct IceParameters { |
| + std::string ufrag; |
| + std::string pwd; |
| + bool renomination; |
|
Taylor Brandstetter
2016/08/08 22:28:16
Why not have "renomination = false" here and then
honghaiz3
2016/08/11 04:57:57
Done. Thanks!
|
| + IceParameters() : renomination(false) {} |
| + IceParameters(const std::string& ice_ufrag, |
| + const std::string& ice_pwd, |
| + bool ice_renomination) |
| + : ufrag(ice_ufrag), pwd(ice_pwd), renomination(ice_renomination) {} |
|
Taylor Brandstetter
2016/08/08 22:28:16
nit: The "ice_" prefix in the names seems redundan
honghaiz3
2016/08/11 04:57:57
I generally prefer that the parameter names are di
Taylor Brandstetter
2016/08/11 22:36:50
Acknowledged; that's a fair point.
honghaiz3
2016/08/12 18:26:40
Acknowledged.
|
| + |
| + 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 +144,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) |