| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/renderer/p2p/port_allocator.h" | 5 #include "content/renderer/p2p/port_allocator.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 } else if (key == "relay.ssltcp_port") { | 275 } else if (key == "relay.ssltcp_port") { |
| 276 if (!ParsePortNumber(value, &relay_ssltcp_port_)) | 276 if (!ParsePortNumber(value, &relay_ssltcp_port_)) |
| 277 return; | 277 return; |
| 278 } | 278 } |
| 279 } | 279 } |
| 280 | 280 |
| 281 AddConfig(); | 281 AddConfig(); |
| 282 } | 282 } |
| 283 | 283 |
| 284 void P2PPortAllocatorSession::AddConfig() { | 284 void P2PPortAllocatorSession::AddConfig() { |
| 285 cricket::PortConfiguration* config = | 285 cricket::PortConfiguration* config = new cricket::PortConfiguration( |
| 286 new cricket::PortConfiguration(stun_server_address_, "", ""); | 286 stun_server_address_, std::string(), std::string()); |
| 287 | 287 |
| 288 if (allocator_->config_.legacy_relay) { | 288 if (allocator_->config_.legacy_relay) { |
| 289 // Passing empty credentials for legacy google relay. | 289 // Passing empty credentials for legacy google relay. |
| 290 cricket::RelayServerConfig gturn_config(cricket::RELAY_GTURN); | 290 cricket::RelayServerConfig gturn_config(cricket::RELAY_GTURN); |
| 291 if (relay_ip_.ip() != 0) { | 291 if (relay_ip_.ip() != 0) { |
| 292 if (relay_udp_port_ > 0) { | 292 if (relay_udp_port_ > 0) { |
| 293 talk_base::SocketAddress address(relay_ip_.ip(), relay_udp_port_); | 293 talk_base::SocketAddress address(relay_ip_.ip(), relay_udp_port_); |
| 294 gturn_config.ports.push_back(cricket::ProtocolAddress( | 294 gturn_config.ports.push_back(cricket::ProtocolAddress( |
| 295 address, cricket::PROTO_UDP)); | 295 address, cricket::PROTO_UDP)); |
| 296 } | 296 } |
| (...skipping 28 matching lines...) Expand all Loading... |
| 325 // Using the stun resolved address if available for TURN. | 325 // Using the stun resolved address if available for TURN. |
| 326 turn_config.ports.push_back(cricket::ProtocolAddress( | 326 turn_config.ports.push_back(cricket::ProtocolAddress( |
| 327 stun_server_address_, cricket::PROTO_UDP)); | 327 stun_server_address_, cricket::PROTO_UDP)); |
| 328 config->AddRelay(turn_config); | 328 config->AddRelay(turn_config); |
| 329 } | 329 } |
| 330 } | 330 } |
| 331 ConfigReady(config); | 331 ConfigReady(config); |
| 332 } | 332 } |
| 333 | 333 |
| 334 } // namespace content | 334 } // namespace content |
| OLD | NEW |