| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "content/public/common/content_switches.h" | 8 #include "content/public/common/content_switches.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 : cricket::BasicPortAllocator(network_manager, socket_factory), | 32 : cricket::BasicPortAllocator(network_manager, socket_factory), |
| 33 socket_dispatcher_(socket_dispatcher), | 33 socket_dispatcher_(socket_dispatcher), |
| 34 config_(config), | 34 config_(config), |
| 35 origin_(origin) | 35 origin_(origin) |
| 36 { | 36 { |
| 37 uint32 flags = 0; | 37 uint32 flags = 0; |
| 38 if (config_.disable_tcp_transport) | 38 if (config_.disable_tcp_transport) |
| 39 flags |= cricket::PORTALLOCATOR_DISABLE_TCP; | 39 flags |= cricket::PORTALLOCATOR_DISABLE_TCP; |
| 40 if (!config_.enable_multiple_routes) | 40 if (!config_.enable_multiple_routes) |
| 41 flags |= cricket::PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION; | 41 flags |= cricket::PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION; |
| 42 if (config_.disable_udp_transport) { |
| 43 flags |= cricket::PORTALLOCATOR_DISABLE_UDP | |
| 44 cricket::PORTALLOCATOR_DISABLE_STUN | |
| 45 cricket::PORTALLOCATOR_DISABLE_TURN_OVER_UDP; |
| 46 } |
| 42 set_flags(flags); | 47 set_flags(flags); |
| 43 set_allow_tcp_listen(false); | 48 set_allow_tcp_listen(false); |
| 44 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); | 49 const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess(); |
| 45 bool enable_webrtc_stun_origin = | 50 bool enable_webrtc_stun_origin = |
| 46 cmd_line->HasSwitch(switches::kEnableWebRtcStunOrigin); | 51 cmd_line->HasSwitch(switches::kEnableWebRtcStunOrigin); |
| 47 if (enable_webrtc_stun_origin) { | 52 if (enable_webrtc_stun_origin) { |
| 48 set_origin(origin.spec()); | 53 set_origin(origin.spec()); |
| 49 } | 54 } |
| 50 } | 55 } |
| 51 | 56 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 config.relays[i].port), | 108 config.relays[i].port), |
| 104 protocol, | 109 protocol, |
| 105 config.relays[i].secure)); | 110 config.relays[i].secure)); |
| 106 relay_server.credentials = credentials; | 111 relay_server.credentials = credentials; |
| 107 port_config->AddRelay(relay_server); | 112 port_config->AddRelay(relay_server); |
| 108 } | 113 } |
| 109 ConfigReady(port_config); | 114 ConfigReady(port_config); |
| 110 } | 115 } |
| 111 | 116 |
| 112 } // namespace content | 117 } // namespace content |
| OLD | NEW |