Index: remoting/host/chromoting_host.cc |
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc |
index 81f87bc2d33382e86afb194a1c6522814953e9bb..1cddf0b8dc578b9131310127e52b6f76b395448a 100644 |
--- a/remoting/host/chromoting_host.cc |
+++ b/remoting/host/chromoting_host.cc |
@@ -17,14 +17,11 @@ |
#include "remoting/host/desktop_environment.h" |
#include "remoting/host/event_executor.h" |
#include "remoting/host/host_config.h" |
-#include "remoting/host/host_port_allocator.h" |
#include "remoting/host/screen_recorder.h" |
#include "remoting/protocol/connection_to_client.h" |
#include "remoting/protocol/client_stub.h" |
#include "remoting/protocol/host_stub.h" |
#include "remoting/protocol/input_stub.h" |
-#include "remoting/protocol/jingle_session_manager.h" |
-#include "remoting/protocol/libjingle_transport_factory.h" |
#include "remoting/protocol/session_config.h" |
using remoting::protocol::ConnectionToClient; |
@@ -66,9 +63,11 @@ ChromotingHost::ChromotingHost( |
ChromotingHostContext* context, |
SignalStrategy* signal_strategy, |
DesktopEnvironment* environment, |
+ scoped_ptr<SessionManagerFactory> session_manager_factory, |
Sergey Ulanov
2012/06/11 23:43:37
Instead of passing the factory here can we pass th
|
const NetworkSettings& network_settings) |
: context_(context), |
desktop_environment_(environment), |
+ session_manager_factory_(session_manager_factory.Pass()), |
network_settings_(network_settings), |
signal_strategy_(signal_strategy), |
stopping_recorders_(0), |
@@ -97,24 +96,9 @@ void ChromotingHost::Start() { |
return; |
state_ = kStarted; |
- // Create port allocator and transport factory. |
- scoped_ptr<HostPortAllocator> port_allocator( |
- HostPortAllocator::Create(context_->url_request_context_getter(), |
- network_settings_)); |
- |
- bool incoming_only = network_settings_.nat_traversal_mode == |
- NetworkSettings::NAT_TRAVERSAL_DISABLED; |
- |
- scoped_ptr<protocol::TransportFactory> transport_factory( |
- new protocol::LibjingleTransportFactory( |
- port_allocator.PassAs<cricket::HttpPortAllocatorBase>(), |
- incoming_only)); |
- |
// Create and start session manager. |
- bool fetch_stun_relay_info = network_settings_.nat_traversal_mode == |
- NetworkSettings::NAT_TRAVERSAL_ENABLED; |
- session_manager_.reset(new protocol::JingleSessionManager( |
- transport_factory.Pass(), fetch_stun_relay_info)); |
+ session_manager_.reset(session_manager_factory_->CreateSessionManager( |
+ network_settings_, context_->url_request_context_getter()).release()); |
session_manager_->Init(signal_strategy_, this); |
} |