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

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

Issue 2568833002: Refactor "secure bool" into explicit PROTO_TLS. (Closed)
Patch Set: GetRelayPreference(): Add RTC_DCHECK(proto == PROTO_UDP). Created 4 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 | « webrtc/p2p/base/port_unittest.cc ('k') | webrtc/p2p/base/portinterface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/portallocator.h
diff --git a/webrtc/p2p/base/portallocator.h b/webrtc/p2p/base/portallocator.h
index 3c81068060a3a717f94e329db7ed541dc86c9e51..25e6e5843d6a87104eb13585747382d934266d15 100644
--- a/webrtc/p2p/base/portallocator.h
+++ b/webrtc/p2p/base/portallocator.h
@@ -119,13 +119,24 @@ struct RelayServerConfig {
int port,
const std::string& username,
const std::string& password,
- ProtocolType proto,
- bool secure)
+ ProtocolType proto)
: type(RELAY_TURN), credentials(username, password) {
- ports.push_back(
- ProtocolAddress(rtc::SocketAddress(address, port), proto, secure));
+ ports.push_back(ProtocolAddress(rtc::SocketAddress(address, port), proto));
}
+ // Legacy constructor where "secure" and PROTO_TCP implies PROTO_TLS.
+ RelayServerConfig(const std::string& address,
+ int port,
+ const std::string& username,
+ const std::string& password,
+ ProtocolType proto,
+ bool secure)
+ : RelayServerConfig(address,
+ port,
+ username,
+ password,
+ (proto == PROTO_TCP && secure ? PROTO_TLS : proto)) {}
+
bool operator==(const RelayServerConfig& o) const {
return type == o.type && ports == o.ports && credentials == o.credentials &&
priority == o.priority;
« no previous file with comments | « webrtc/p2p/base/port_unittest.cc ('k') | webrtc/p2p/base/portinterface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698