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

Side by Side Diff: webrtc/p2p/base/portallocator.h

Issue 2926823003: Allow passing both hostname and IP of ICE server into PeerConnection. (Closed)
Patch Set: Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « webrtc/api/peerconnectioninterface.h ('k') | webrtc/pc/iceserverparsing.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 122
123 std::string username; 123 std::string username;
124 std::string password; 124 std::string password;
125 }; 125 };
126 126
127 typedef std::vector<ProtocolAddress> PortList; 127 typedef std::vector<ProtocolAddress> PortList;
128 // TODO(deadbeef): Rename to TurnServerConfig. 128 // TODO(deadbeef): Rename to TurnServerConfig.
129 struct RelayServerConfig { 129 struct RelayServerConfig {
130 RelayServerConfig(RelayType type) : type(type) {} 130 RelayServerConfig(RelayType type) : type(type) {}
131 131
132 RelayServerConfig(const std::string& address, 132 RelayServerConfig(const rtc::SocketAddress& address,
133 int port,
134 const std::string& username, 133 const std::string& username,
135 const std::string& password, 134 const std::string& password,
136 ProtocolType proto) 135 ProtocolType proto)
137 : type(RELAY_TURN), credentials(username, password) { 136 : type(RELAY_TURN), credentials(username, password) {
138 ports.push_back(ProtocolAddress(rtc::SocketAddress(address, port), proto)); 137 ports.push_back(ProtocolAddress(address, proto));
139 } 138 }
140 139
141 // Legacy constructor where "secure" and PROTO_TCP implies PROTO_TLS. 140 // Legacy constructor where "secure" and PROTO_TCP implies PROTO_TLS.
142 RelayServerConfig(const std::string& address, 141 RelayServerConfig(const std::string& address,
143 int port, 142 int port,
144 const std::string& username, 143 const std::string& username,
145 const std::string& password, 144 const std::string& password,
146 ProtocolType proto, 145 ProtocolType proto,
147 bool secure) 146 bool secure)
148 : RelayServerConfig(address, 147 : RelayServerConfig(rtc::SocketAddress(address, port),
149 port,
150 username, 148 username,
151 password, 149 password,
152 (proto == PROTO_TCP && secure ? PROTO_TLS : proto)) {} 150 (proto == PROTO_TCP && secure ? PROTO_TLS : proto)) {}
153 151
154 bool operator==(const RelayServerConfig& o) const { 152 bool operator==(const RelayServerConfig& o) const {
155 return type == o.type && ports == o.ports && credentials == o.credentials && 153 return type == o.type && ports == o.ports && credentials == o.credentials &&
156 priority == o.priority; 154 priority == o.priority;
157 } 155 }
158 bool operator!=(const RelayServerConfig& o) const { return !(*this == o); } 156 bool operator!=(const RelayServerConfig& o) const { return !(*this == o); }
159 157
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_; 460 std::deque<std::unique_ptr<PortAllocatorSession>> pooled_sessions_;
463 bool candidate_pool_frozen_ = false; 461 bool candidate_pool_frozen_ = false;
464 bool prune_turn_ports_ = false; 462 bool prune_turn_ports_ = false;
465 463
466 webrtc::MetricsObserverInterface* metrics_observer_ = nullptr; 464 webrtc::MetricsObserverInterface* metrics_observer_ = nullptr;
467 }; 465 };
468 466
469 } // namespace cricket 467 } // namespace cricket
470 468
471 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_ 469 #endif // WEBRTC_P2P_BASE_PORTALLOCATOR_H_
OLDNEW
« no previous file with comments | « webrtc/api/peerconnectioninterface.h ('k') | webrtc/pc/iceserverparsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698