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

Side by Side Diff: webrtc/api/peerconnection.cc

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 unified diff | Download patch
« no previous file with comments | « no previous file | webrtc/api/peerconnection_unittest.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 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 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 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 } 278 }
279 username.assign(rtc::s_url_decode(tokens[0])); 279 username.assign(rtc::s_url_decode(tokens[0]));
280 hoststring = tokens[1]; 280 hoststring = tokens[1];
281 } else { 281 } else {
282 hoststring = tokens[0]; 282 hoststring = tokens[0];
283 } 283 }
284 284
285 int port = kDefaultStunPort; 285 int port = kDefaultStunPort;
286 if (service_type == TURNS) { 286 if (service_type == TURNS) {
287 port = kDefaultStunTlsPort; 287 port = kDefaultStunTlsPort;
288 turn_transport_type = cricket::PROTO_TCP; 288 turn_transport_type = cricket::PROTO_TLS;
289 } 289 }
290 290
291 std::string address; 291 std::string address;
292 if (!ParseHostnameAndPortFromString(hoststring, &address, &port)) { 292 if (!ParseHostnameAndPortFromString(hoststring, &address, &port)) {
293 LOG(WARNING) << "Invalid hostname format: " << uri_without_transport; 293 LOG(WARNING) << "Invalid hostname format: " << uri_without_transport;
294 return false; 294 return false;
295 } 295 }
296 296
297 if (port <= 0 || port > 0xffff) { 297 if (port <= 0 || port > 0xffff) {
298 LOG(WARNING) << "Invalid port: " << port; 298 LOG(WARNING) << "Invalid port: " << port;
299 return false; 299 return false;
300 } 300 }
301 301
302 switch (service_type) { 302 switch (service_type) {
303 case STUN: 303 case STUN:
304 case STUNS: 304 case STUNS:
305 stun_servers->insert(rtc::SocketAddress(address, port)); 305 stun_servers->insert(rtc::SocketAddress(address, port));
306 break; 306 break;
307 case TURN: 307 case TURN:
308 case TURNS: { 308 case TURNS: {
309 bool secure = (service_type == TURNS); 309 turn_servers->push_back(cricket::RelayServerConfig(
310 turn_servers->push_back( 310 address, port, username, server.password, turn_transport_type));
311 cricket::RelayServerConfig(address, port, username, server.password,
312 turn_transport_type, secure));
313 break; 311 break;
314 } 312 }
315 case INVALID: 313 case INVALID:
316 default: 314 default:
317 LOG(WARNING) << "Configuration not supported: " << url; 315 LOG(WARNING) << "Configuration not supported: " << url;
318 return false; 316 return false;
319 } 317 }
320 return true; 318 return true;
321 } 319 }
322 320
(...skipping 2071 matching lines...) Expand 10 before | Expand all | Expand 10 after
2394 2392
2395 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, 2393 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file,
2396 int64_t max_size_bytes) { 2394 int64_t max_size_bytes) {
2397 return event_log_->StartLogging(file, max_size_bytes); 2395 return event_log_->StartLogging(file, max_size_bytes);
2398 } 2396 }
2399 2397
2400 void PeerConnection::StopRtcEventLog_w() { 2398 void PeerConnection::StopRtcEventLog_w() {
2401 event_log_->StopLogging(); 2399 event_log_->StopLogging();
2402 } 2400 }
2403 } // namespace webrtc 2401 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/peerconnection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698