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 namespace content { | 7 namespace content { |
8 | 8 |
9 P2PPortAllocator::Config::Config() | 9 P2PPortAllocator::Config::Config() |
10 : disable_tcp_transport(false) { | 10 : disable_tcp_transport(false) { |
(...skipping 13 matching lines...) Expand all Loading... |
24 P2PSocketDispatcher* socket_dispatcher, | 24 P2PSocketDispatcher* socket_dispatcher, |
25 rtc::NetworkManager* network_manager, | 25 rtc::NetworkManager* network_manager, |
26 rtc::PacketSocketFactory* socket_factory, | 26 rtc::PacketSocketFactory* socket_factory, |
27 const Config& config) | 27 const Config& config) |
28 : cricket::BasicPortAllocator(network_manager, socket_factory), | 28 : cricket::BasicPortAllocator(network_manager, socket_factory), |
29 socket_dispatcher_(socket_dispatcher), | 29 socket_dispatcher_(socket_dispatcher), |
30 config_(config) { | 30 config_(config) { |
31 uint32 flags = 0; | 31 uint32 flags = 0; |
32 if (config_.disable_tcp_transport) | 32 if (config_.disable_tcp_transport) |
33 flags |= cricket::PORTALLOCATOR_DISABLE_TCP; | 33 flags |= cricket::PORTALLOCATOR_DISABLE_TCP; |
| 34 if (config_.disable_multiple_routes) |
| 35 flags |= cricket::PORTALLOCATOR_DISABLE_ADAPTER_ENUMERATION; |
34 set_flags(flags); | 36 set_flags(flags); |
35 set_allow_tcp_listen(false); | 37 set_allow_tcp_listen(false); |
36 } | 38 } |
37 | 39 |
38 P2PPortAllocator::~P2PPortAllocator() { | 40 P2PPortAllocator::~P2PPortAllocator() { |
39 } | 41 } |
40 | 42 |
41 cricket::PortAllocatorSession* P2PPortAllocator::CreateSessionInternal( | 43 cricket::PortAllocatorSession* P2PPortAllocator::CreateSessionInternal( |
42 const std::string& content_name, | 44 const std::string& content_name, |
43 int component, | 45 int component, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 config.relays[i].port), | 91 config.relays[i].port), |
90 protocol, | 92 protocol, |
91 config.relays[i].secure)); | 93 config.relays[i].secure)); |
92 relay_server.credentials = credentials; | 94 relay_server.credentials = credentials; |
93 port_config->AddRelay(relay_server); | 95 port_config->AddRelay(relay_server); |
94 } | 96 } |
95 ConfigReady(port_config); | 97 ConfigReady(port_config); |
96 } | 98 } |
97 | 99 |
98 } // namespace content | 100 } // namespace content |
OLD | NEW |