Chromium Code Reviews| Index: remoting/protocol/session_manager_factory.cc |
| diff --git a/remoting/host/session_manager_factory.cc b/remoting/protocol/session_manager_factory.cc |
| similarity index 62% |
| rename from remoting/host/session_manager_factory.cc |
| rename to remoting/protocol/session_manager_factory.cc |
| index df2178675a728a91c01c7445a506ad7d62af6cd9..adcb125370d0c0f05cd7950a184c43efbb978949 100644 |
| --- a/remoting/host/session_manager_factory.cc |
| +++ b/remoting/protocol/session_manager_factory.cc |
| @@ -2,34 +2,46 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "remoting/host/session_manager_factory.h" |
| +#include "remoting/protocol/session_manager_factory.h" |
| -#include "net/url_request/url_request_context_getter.h" |
| -#include "remoting/host/host_port_allocator.h" |
| -#include "remoting/host/network_settings.h" |
| -#include "remoting/protocol/libjingle_transport_factory.h" |
| #include "remoting/protocol/jingle_session_manager.h" |
| +#include "remoting/protocol/libjingle_transport_factory.h" |
| +#include "remoting/protocol/native_port_allocator.h" |
| +#include "remoting/protocol/network_settings.h" |
| +#include "remoting/protocol/session_manager.h" |
| namespace remoting { |
| -scoped_ptr<protocol::SessionManager> CreateHostSessionManager( |
| +namespace protocol { |
| + |
| +scoped_ptr<protocol::TransportFactory> CreateTransportFactory( |
|
Sergey Ulanov
2013/06/20 19:37:53
This function doesn't belong to this file. It woul
|
| const NetworkSettings& network_settings, |
| const scoped_refptr<net::URLRequestContextGetter>& |
| url_request_context_getter) { |
| // Use Chrome's network stack to allocate ports for peer-to-peer channels. |
| - scoped_ptr<HostPortAllocator> port_allocator( |
| - HostPortAllocator::Create(url_request_context_getter, |
| + scoped_ptr<NativePortAllocator> port_allocator( |
| + NativePortAllocator::Create(url_request_context_getter, |
| network_settings)); |
| bool incoming_only = network_settings.nat_traversal_mode == |
| NetworkSettings::NAT_TRAVERSAL_DISABLED; |
| // Use libjingle for negotiation of peer-to-peer channels over |
| - // HostPortAllocator allocated ports. |
| + // NativePortAllocator allocated ports. |
| scoped_ptr<protocol::TransportFactory> transport_factory( |
| new protocol::LibjingleTransportFactory( |
| port_allocator.PassAs<cricket::HttpPortAllocatorBase>(), |
| incoming_only)); |
| + return transport_factory.Pass(); |
| +} |
| + |
| +scoped_ptr<protocol::SessionManager> CreateNativeSessionManager( |
|
Sergey Ulanov
2013/06/20 19:37:53
This function doesn't do much, so I don't think we
|
| + const NetworkSettings& network_settings, |
| + const scoped_refptr<net::URLRequestContextGetter>& |
| + url_request_context_getter) { |
| + scoped_ptr<protocol::TransportFactory> transport_factory( |
| + CreateTransportFactory(network_settings, |
| + url_request_context_getter)); |
|
Sergey Ulanov
2013/06/20 19:37:53
this argument should be aligned with the first arg
|
| // Use the Jingle protocol for channel-negotiation signalling between |
| // peer TransportFactories. |
| @@ -42,4 +54,6 @@ scoped_ptr<protocol::SessionManager> CreateHostSessionManager( |
| return session_manager.PassAs<protocol::SessionManager>(); |
| } |
| +} // namespace protocol |
| + |
| } // namespace remoting |