OLD | NEW |
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 "base/memory/ptr_util.h" |
8 #include "remoting/protocol/transport_context.h" | 9 #include "remoting/protocol/transport_context.h" |
9 #include "remoting/test/fake_network_dispatcher.h" | 10 #include "remoting/test/fake_network_dispatcher.h" |
10 #include "remoting/test/fake_network_manager.h" | 11 #include "remoting/test/fake_network_manager.h" |
11 #include "remoting/test/fake_socket_factory.h" | 12 #include "remoting/test/fake_socket_factory.h" |
12 #include "third_party/webrtc/p2p/client/basicportallocator.h" | 13 #include "third_party/webrtc/p2p/client/basicportallocator.h" |
13 | 14 |
14 namespace remoting { | 15 namespace remoting { |
15 | 16 |
16 namespace { | 17 namespace { |
17 | 18 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 71 |
71 FakePortAllocatorFactory::FakePortAllocatorFactory( | 72 FakePortAllocatorFactory::FakePortAllocatorFactory( |
72 scoped_refptr<FakeNetworkDispatcher> fake_network_dispatcher) { | 73 scoped_refptr<FakeNetworkDispatcher> fake_network_dispatcher) { |
73 socket_factory_.reset( | 74 socket_factory_.reset( |
74 new FakePacketSocketFactory(fake_network_dispatcher.get())); | 75 new FakePacketSocketFactory(fake_network_dispatcher.get())); |
75 network_manager_.reset(new FakeNetworkManager(socket_factory_->GetAddress())); | 76 network_manager_.reset(new FakeNetworkManager(socket_factory_->GetAddress())); |
76 } | 77 } |
77 | 78 |
78 FakePortAllocatorFactory::~FakePortAllocatorFactory() {} | 79 FakePortAllocatorFactory::~FakePortAllocatorFactory() {} |
79 | 80 |
80 scoped_ptr<cricket::PortAllocator> | 81 std::unique_ptr<cricket::PortAllocator> |
81 FakePortAllocatorFactory::CreatePortAllocator( | 82 FakePortAllocatorFactory::CreatePortAllocator( |
82 scoped_refptr<protocol::TransportContext> transport_context) { | 83 scoped_refptr<protocol::TransportContext> transport_context) { |
83 return make_scoped_ptr(new FakePortAllocator( | 84 return base::WrapUnique(new FakePortAllocator( |
84 network_manager_.get(), socket_factory_.get(), transport_context)); | 85 network_manager_.get(), socket_factory_.get(), transport_context)); |
85 } | 86 } |
86 | 87 |
87 } // namespace remoting | 88 } // namespace remoting |
OLD | NEW |