OLD | NEW |
| (Empty) |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "remoting/protocol/chromium_port_allocator_factory.h" | |
6 | |
7 #include "base/logging.h" | |
8 #include "net/url_request/url_request_context_getter.h" | |
9 #include "remoting/protocol/chromium_port_allocator.h" | |
10 #include "remoting/protocol/network_settings.h" | |
11 | |
12 namespace remoting { | |
13 namespace protocol { | |
14 | |
15 ChromiumPortAllocatorFactory::ChromiumPortAllocatorFactory( | |
16 const NetworkSettings& network_settings, | |
17 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter) | |
18 : network_settings_(network_settings), | |
19 url_request_context_getter_(url_request_context_getter) {} | |
20 | |
21 ChromiumPortAllocatorFactory::~ChromiumPortAllocatorFactory() {} | |
22 | |
23 scoped_ptr<PortAllocatorFactory> ChromiumPortAllocatorFactory::Create( | |
24 const NetworkSettings& network_settings, | |
25 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter) { | |
26 return scoped_ptr<PortAllocatorFactory>(new ChromiumPortAllocatorFactory( | |
27 network_settings, url_request_context_getter)); | |
28 } | |
29 | |
30 cricket::PortAllocator* ChromiumPortAllocatorFactory::CreatePortAllocator() { | |
31 scoped_ptr<ChromiumPortAllocator> port_allocator( | |
32 ChromiumPortAllocator::Create(url_request_context_getter_, | |
33 network_settings_)); | |
34 return port_allocator.release(); | |
35 } | |
36 | |
37 } // namespace protocol | |
38 } // namespace remoting | |
39 | |
OLD | NEW |