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

Side by Side Diff: remoting/test/fake_port_allocator.cc

Issue 1143893002: Fix FakePortAllocator to work with standard ICE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "remoting/test/fake_port_allocator.h" 5 #include "remoting/test/fake_port_allocator.h"
6 6
7 #include "remoting/test/fake_network_dispatcher.h" 7 #include "remoting/test/fake_network_dispatcher.h"
8 #include "remoting/test/fake_network_manager.h" 8 #include "remoting/test/fake_network_manager.h"
9 #include "remoting/test/fake_socket_factory.h" 9 #include "remoting/test/fake_socket_factory.h"
10 10
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 const std::string& relay) 45 const std::string& relay)
46 : HttpPortAllocatorSessionBase(allocator, 46 : HttpPortAllocatorSessionBase(allocator,
47 content_name, 47 content_name,
48 component, 48 component,
49 ice_username_fragment, 49 ice_username_fragment,
50 ice_password, 50 ice_password,
51 stun_hosts, 51 stun_hosts,
52 relay_hosts, 52 relay_hosts,
53 relay, 53 relay,
54 std::string()) { 54 std::string()) {
55 set_flags(cricket::PORTALLOCATOR_DISABLE_TCP |
56 cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG |
57 cricket::PORTALLOCATOR_ENABLE_IPV6 |
58 cricket::PORTALLOCATOR_DISABLE_STUN |
59 cricket::PORTALLOCATOR_DISABLE_RELAY);
60 } 55 }
61 56
62 FakePortAllocatorSession::~FakePortAllocatorSession() { 57 FakePortAllocatorSession::~FakePortAllocatorSession() {
63 } 58 }
64 59
65 void FakePortAllocatorSession::ConfigReady( 60 void FakePortAllocatorSession::ConfigReady(
66 cricket::PortConfiguration* config) { 61 cricket::PortConfiguration* config) {
67 // Filter out non-UDP relay ports, so that we don't try using TCP. 62 // Filter out non-UDP relay ports, so that we don't try using TCP.
68 for (cricket::PortConfiguration::RelayList::iterator relay = 63 for (cricket::PortConfiguration::RelayList::iterator relay =
69 config->relays.begin(); relay != config->relays.end(); ++relay) { 64 config->relays.begin(); relay != config->relays.end(); ++relay) {
(...skipping 29 matching lines...) Expand all
99 new FakePortAllocator(network_manager.Pass(), socket_factory.Pass())); 94 new FakePortAllocator(network_manager.Pass(), socket_factory.Pass()));
100 } 95 }
101 96
102 FakePortAllocator::FakePortAllocator( 97 FakePortAllocator::FakePortAllocator(
103 scoped_ptr<rtc::NetworkManager> network_manager, 98 scoped_ptr<rtc::NetworkManager> network_manager,
104 scoped_ptr<FakePacketSocketFactory> socket_factory) 99 scoped_ptr<FakePacketSocketFactory> socket_factory)
105 : HttpPortAllocatorBase(network_manager.get(), 100 : HttpPortAllocatorBase(network_manager.get(),
106 socket_factory.get(), 101 socket_factory.get(),
107 std::string()), 102 std::string()),
108 network_manager_(network_manager.Pass()), 103 network_manager_(network_manager.Pass()),
109 socket_factory_(socket_factory.Pass()) {} 104 socket_factory_(socket_factory.Pass()) {
105 set_flags(cricket::PORTALLOCATOR_DISABLE_TCP |
106 cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG |
107 cricket::PORTALLOCATOR_ENABLE_IPV6 |
108 cricket::PORTALLOCATOR_DISABLE_STUN |
109 cricket::PORTALLOCATOR_DISABLE_RELAY);
110 }
110 111
111 FakePortAllocator::~FakePortAllocator() { 112 FakePortAllocator::~FakePortAllocator() {
112 } 113 }
113 114
114 cricket::PortAllocatorSession* FakePortAllocator::CreateSessionInternal( 115 cricket::PortAllocatorSession* FakePortAllocator::CreateSessionInternal(
115 const std::string& content_name, 116 const std::string& content_name,
116 int component, 117 int component,
117 const std::string& ice_username_fragment, 118 const std::string& ice_username_fragment,
118 const std::string& ice_password) { 119 const std::string& ice_password) {
119 return new FakePortAllocatorSession( 120 return new FakePortAllocatorSession(
120 this, content_name, component, ice_username_fragment, ice_password, 121 this, content_name, component, ice_username_fragment, ice_password,
121 stun_hosts(), relay_hosts(), relay_token()); 122 stun_hosts(), relay_hosts(), relay_token());
122 } 123 }
123 124
124 } // namespace remoting 125 } // namespace remoting
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698