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 "remoting/host/session_manager_factory.h" | 5 #include "remoting/host/session_manager_factory.h" |
6 | 6 |
7 #include "remoting/protocol/chromium_port_allocator.h" | 7 #include "remoting/protocol/chromium_port_allocator.h" |
8 #include "remoting/protocol/chromium_socket_factory.h" | 8 #include "remoting/protocol/chromium_socket_factory.h" |
9 #include "remoting/protocol/jingle_session_manager.h" | 9 #include "remoting/protocol/jingle_session_manager.h" |
10 #include "remoting/protocol/libjingle_transport_factory.h" | 10 #include "remoting/protocol/libjingle_transport_factory.h" |
11 #include "remoting/protocol/network_settings.h" | 11 #include "remoting/protocol/network_settings.h" |
12 #include "remoting/protocol/session_manager.h" | 12 #include "remoting/protocol/session_manager.h" |
13 | 13 |
14 namespace remoting { | 14 namespace remoting { |
15 | 15 |
16 scoped_ptr<protocol::SessionManager> CreateHostSessionManager( | 16 scoped_ptr<protocol::SessionManager> CreateHostSessionManager( |
17 SignalStrategy* signal_strategy, | 17 SignalStrategy* signal_strategy, |
18 const protocol::NetworkSettings& network_settings, | 18 const protocol::NetworkSettings& network_settings, |
19 const scoped_refptr<net::URLRequestContextGetter>& | 19 const scoped_refptr<net::URLRequestContextGetter>& |
20 url_request_context_getter) { | 20 url_request_context_getter) { |
21 // Use Chrome's network stack to allocate ports for peer-to-peer channels. | 21 // Use Chrome's network stack to allocate ports for peer-to-peer channels. |
22 scoped_ptr<protocol::ChromiumPortAllocator> port_allocator( | 22 scoped_ptr<protocol::ChromiumPortAllocator> port_allocator( |
23 protocol::ChromiumPortAllocator::Create(url_request_context_getter, | 23 protocol::ChromiumPortAllocator::Create(url_request_context_getter, |
24 network_settings)); | 24 network_settings)); |
25 | 25 |
26 scoped_ptr<protocol::TransportFactory> transport_factory( | 26 scoped_ptr<protocol::TransportFactory> transport_factory( |
27 new protocol::LibjingleTransportFactory( | 27 new protocol::LibjingleTransportFactory( |
28 signal_strategy, | 28 signal_strategy, port_allocator.Pass(), network_settings)); |
29 port_allocator.PassAs<cricket::HttpPortAllocatorBase>(), | |
30 network_settings)); | |
31 | 29 |
32 scoped_ptr<protocol::JingleSessionManager> session_manager( | 30 scoped_ptr<protocol::JingleSessionManager> session_manager( |
33 new protocol::JingleSessionManager(transport_factory.Pass())); | 31 new protocol::JingleSessionManager(transport_factory.Pass())); |
34 return session_manager.PassAs<protocol::SessionManager>(); | 32 return session_manager.Pass(); |
35 } | 33 } |
36 | 34 |
37 } // namespace remoting | 35 } // namespace remoting |
OLD | NEW |