| 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/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 talk_base::PacketSocketFactory* socket_factory, | 73 talk_base::PacketSocketFactory* socket_factory, |
| 74 const Config& config) | 74 const Config& config) |
| 75 : cricket::BasicPortAllocator(network_manager, socket_factory), | 75 : cricket::BasicPortAllocator(network_manager, socket_factory), |
| 76 web_frame_(web_frame), | 76 web_frame_(web_frame), |
| 77 socket_dispatcher_(socket_dispatcher), | 77 socket_dispatcher_(socket_dispatcher), |
| 78 config_(config) { | 78 config_(config) { |
| 79 uint32 flags = 0; | 79 uint32 flags = 0; |
| 80 if (config_.disable_tcp_transport) | 80 if (config_.disable_tcp_transport) |
| 81 flags |= cricket::PORTALLOCATOR_DISABLE_TCP; | 81 flags |= cricket::PORTALLOCATOR_DISABLE_TCP; |
| 82 set_flags(flags); | 82 set_flags(flags); |
| 83 // TODO(ronghuawu): crbug/138185 add ourselves to the firewall list in browser | 83 set_allow_tcp_listen(false); |
| 84 // process and then remove below line. | |
| 85 if (!CommandLine::ForCurrentProcess()->HasSwitch( | |
| 86 switches::kEnableWebRtcTcpServerSocket)) { | |
| 87 set_allow_tcp_listen(false); | |
| 88 } | |
| 89 } | 84 } |
| 90 | 85 |
| 91 P2PPortAllocator::~P2PPortAllocator() { | 86 P2PPortAllocator::~P2PPortAllocator() { |
| 92 } | 87 } |
| 93 | 88 |
| 94 cricket::PortAllocatorSession* P2PPortAllocator::CreateSessionInternal( | 89 cricket::PortAllocatorSession* P2PPortAllocator::CreateSessionInternal( |
| 95 const std::string& content_name, | 90 const std::string& content_name, |
| 96 int component, | 91 int component, |
| 97 const std::string& ice_username_fragment, | 92 const std::string& ice_username_fragment, |
| 98 const std::string& ice_password) { | 93 const std::string& ice_password) { |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 config.relays[i].port), | 282 config.relays[i].port), |
| 288 protocol, | 283 protocol, |
| 289 config.relays[i].secure)); | 284 config.relays[i].secure)); |
| 290 relay_server.credentials = credentials; | 285 relay_server.credentials = credentials; |
| 291 port_config->AddRelay(relay_server); | 286 port_config->AddRelay(relay_server); |
| 292 } | 287 } |
| 293 ConfigReady(port_config); | 288 ConfigReady(port_config); |
| 294 } | 289 } |
| 295 | 290 |
| 296 } // namespace content | 291 } // namespace content |
| OLD | NEW |