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

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

Issue 1644593003: Fix FakePortAllocator to keep reference to TransportContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « remoting/test/fake_port_allocator.h ('k') | 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 "base/macros.h" 7 #include "base/macros.h"
8 #include "remoting/protocol/transport_context.h" 8 #include "remoting/protocol/transport_context.h"
9 #include "remoting/test/fake_network_dispatcher.h" 9 #include "remoting/test/fake_network_dispatcher.h"
10 #include "remoting/test/fake_network_manager.h" 10 #include "remoting/test/fake_network_manager.h"
(...skipping 28 matching lines...) Expand all
39 component, 39 component,
40 ice_username_fragment, 40 ice_username_fragment,
41 ice_password) {} 41 ice_password) {}
42 42
43 FakePortAllocatorSession::~FakePortAllocatorSession() {} 43 FakePortAllocatorSession::~FakePortAllocatorSession() {}
44 44
45 } // namespace 45 } // namespace
46 46
47 FakePortAllocator::FakePortAllocator( 47 FakePortAllocator::FakePortAllocator(
48 rtc::NetworkManager* network_manager, 48 rtc::NetworkManager* network_manager,
49 rtc::PacketSocketFactory* socket_factory) 49 rtc::PacketSocketFactory* socket_factory,
50 : BasicPortAllocator(network_manager, socket_factory) { 50 scoped_refptr<protocol::TransportContext> transport_context)
51 : BasicPortAllocator(network_manager, socket_factory),
52 transport_context_(transport_context) {
51 set_flags(cricket::PORTALLOCATOR_DISABLE_TCP | 53 set_flags(cricket::PORTALLOCATOR_DISABLE_TCP |
52 cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG | 54 cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG |
53 cricket::PORTALLOCATOR_ENABLE_IPV6 | 55 cricket::PORTALLOCATOR_ENABLE_IPV6 |
54 cricket::PORTALLOCATOR_DISABLE_STUN | 56 cricket::PORTALLOCATOR_DISABLE_STUN |
55 cricket::PORTALLOCATOR_DISABLE_RELAY); 57 cricket::PORTALLOCATOR_DISABLE_RELAY);
56 } 58 }
57 59
58 FakePortAllocator::~FakePortAllocator() {} 60 FakePortAllocator::~FakePortAllocator() {}
59 61
60 cricket::PortAllocatorSession* FakePortAllocator::CreateSessionInternal( 62 cricket::PortAllocatorSession* FakePortAllocator::CreateSessionInternal(
(...skipping 10 matching lines...) Expand all
71 socket_factory_.reset( 73 socket_factory_.reset(
72 new FakePacketSocketFactory(fake_network_dispatcher.get())); 74 new FakePacketSocketFactory(fake_network_dispatcher.get()));
73 network_manager_.reset(new FakeNetworkManager(socket_factory_->GetAddress())); 75 network_manager_.reset(new FakeNetworkManager(socket_factory_->GetAddress()));
74 } 76 }
75 77
76 FakePortAllocatorFactory::~FakePortAllocatorFactory() {} 78 FakePortAllocatorFactory::~FakePortAllocatorFactory() {}
77 79
78 scoped_ptr<cricket::PortAllocator> 80 scoped_ptr<cricket::PortAllocator>
79 FakePortAllocatorFactory::CreatePortAllocator( 81 FakePortAllocatorFactory::CreatePortAllocator(
80 scoped_refptr<protocol::TransportContext> transport_context) { 82 scoped_refptr<protocol::TransportContext> transport_context) {
81 return make_scoped_ptr( 83 return make_scoped_ptr(new FakePortAllocator(
82 new FakePortAllocator(network_manager_.get(), socket_factory_.get())); 84 network_manager_.get(), socket_factory_.get(), transport_context));
83 } 85 }
84 86
85 } // namespace remoting 87 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/test/fake_port_allocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698