| Index: remoting/host/plugin/host_script_object.cc
|
| diff --git a/remoting/host/plugin/host_script_object.cc b/remoting/host/plugin/host_script_object.cc
|
| index 15b5ceef9188c47de9f77768cfec162e88f31107..a3869023f1c2f2cecac7addaba87fdc5192bebfa 100644
|
| --- a/remoting/host/plugin/host_script_object.cc
|
| +++ b/remoting/host/plugin/host_script_object.cc
|
| @@ -94,7 +94,6 @@ HostNPScriptObject::HostNPScriptObject(
|
| np_thread_id_(base::PlatformThread::CurrentId()),
|
| plugin_task_runner_(
|
| new PluginThreadTaskRunner(plugin_thread_delegate)),
|
| - desktop_environment_factory_(new DesktopEnvironmentFactory()),
|
| failed_login_attempts_(0),
|
| disconnected_event_(true, false),
|
| stopped_event_(true, false),
|
| @@ -111,7 +110,7 @@ HostNPScriptObject::~HostNPScriptObject() {
|
| HostLogHandler::UnregisterLoggingScriptObject(this);
|
|
|
| // Stop the message loop. Any attempt to post a task to
|
| - // |context_.ui_task_runner()| will result in a CHECK() after this point.
|
| + // |host_context_.ui_task_runner()| will result in a CHECK() after this point.
|
| // TODO(alexeypa): Enable posting messages to |plugin_task_runner_| during
|
| // shutdown to avoid this hack.
|
| plugin_task_runner_->Detach();
|
| @@ -161,6 +160,7 @@ bool HostNPScriptObject::Init() {
|
| DCHECK(plugin_task_runner_->BelongsToCurrentThread());
|
| VLOG(2) << "Init";
|
|
|
| + // Create threads for the Chromoting host & desktop environment to use.
|
| host_context_.reset(new ChromotingHostContext(new AutoThreadTaskRunner(
|
| plugin_task_runner_,
|
| base::Bind(&base::WaitableEvent::Signal,
|
| @@ -170,6 +170,11 @@ bool HostNPScriptObject::Init() {
|
| return false;
|
| }
|
|
|
| + // Create the desktop environment factory.
|
| + desktop_environment_factory_.reset(new DesktopEnvironmentFactory(
|
| + host_context_->input_task_runner(), host_context_->ui_task_runner()));
|
| +
|
| + // Start monitoring configured policies.
|
| policy_watcher_.reset(
|
| policy_hack::PolicyWatcher::Create(host_context_->network_task_runner()));
|
| policy_watcher_->StartWatching(
|
| @@ -586,10 +591,13 @@ void HostNPScriptObject::FinishConnect(
|
|
|
| // Create the host.
|
| host_ = new ChromotingHost(
|
| - host_context_.get(), signal_strategy_.get(),
|
| + signal_strategy_.get(),
|
| desktop_environment_factory_.get(),
|
| CreateHostSessionManager(network_settings,
|
| - host_context_->url_request_context_getter()));
|
| + host_context_->url_request_context_getter()),
|
| + host_context_->capture_task_runner(),
|
| + host_context_->encode_task_runner(),
|
| + host_context_->network_task_runner());
|
| host_->AddStatusObserver(this);
|
| log_to_server_.reset(
|
| new LogToServer(host_, ServerLogEntry::IT2ME, signal_strategy_.get()));
|
|
|