| 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/plugin/host_script_object.h" | 5 #include "remoting/host/plugin/host_script_object.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 const std::string& auth_service) { | 207 const std::string& auth_service) { |
| 208 if (!host_context_->ui_task_runner()->BelongsToCurrentThread()) { | 208 if (!host_context_->ui_task_runner()->BelongsToCurrentThread()) { |
| 209 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); | 209 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); |
| 210 host_context_->ui_task_runner()->PostTask( | 210 host_context_->ui_task_runner()->PostTask( |
| 211 FROM_HERE, | 211 FROM_HERE, |
| 212 base::Bind(&It2MeImpl::Connect, this, uid, auth_token, auth_service)); | 212 base::Bind(&It2MeImpl::Connect, this, uid, auth_token, auth_service)); |
| 213 return; | 213 return; |
| 214 } | 214 } |
| 215 | 215 |
| 216 // Create the desktop environment factory. | 216 // Create the desktop environment factory. |
| 217 desktop_environment_factory_.reset(new DesktopEnvironmentFactory( | 217 desktop_environment_factory_.reset( |
| 218 host_context_->input_task_runner(), host_context_->ui_task_runner())); | 218 new DesktopEnvironmentFactory(host_context_->network_task_runner())); |
| 219 | 219 |
| 220 // Start monitoring configured policies. | 220 // Start monitoring configured policies. |
| 221 policy_watcher_.reset( | 221 policy_watcher_.reset( |
| 222 policy_hack::PolicyWatcher::Create(host_context_->network_task_runner())); | 222 policy_hack::PolicyWatcher::Create(host_context_->network_task_runner())); |
| 223 policy_watcher_->StartWatching( | 223 policy_watcher_->StartWatching( |
| 224 base::Bind(&It2MeImpl::OnPolicyUpdate, this)); | 224 base::Bind(&It2MeImpl::OnPolicyUpdate, this)); |
| 225 | 225 |
| 226 // The UserInterface object needs to be created on the UI thread. | 226 // The UserInterface object needs to be created on the UI thread. |
| 227 it2me_host_user_interface_.reset( | 227 it2me_host_user_interface_.reset( |
| 228 new It2MeHostUserInterface(host_context_->network_task_runner(), | 228 new It2MeHostUserInterface(host_context_->network_task_runner(), |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 359 network_settings.max_port = NetworkSettings::kDefaultMaxPort; | 359 network_settings.max_port = NetworkSettings::kDefaultMaxPort; |
| 360 } | 360 } |
| 361 | 361 |
| 362 // Create the host. | 362 // Create the host. |
| 363 host_ = new ChromotingHost( | 363 host_ = new ChromotingHost( |
| 364 signal_strategy_.get(), | 364 signal_strategy_.get(), |
| 365 desktop_environment_factory_.get(), | 365 desktop_environment_factory_.get(), |
| 366 CreateHostSessionManager(network_settings, | 366 CreateHostSessionManager(network_settings, |
| 367 host_context_->url_request_context_getter()), | 367 host_context_->url_request_context_getter()), |
| 368 host_context_->audio_task_runner(), | 368 host_context_->audio_task_runner(), |
| 369 host_context_->input_task_runner(), |
| 369 host_context_->video_capture_task_runner(), | 370 host_context_->video_capture_task_runner(), |
| 370 host_context_->video_encode_task_runner(), | 371 host_context_->video_encode_task_runner(), |
| 371 host_context_->network_task_runner()); | 372 host_context_->network_task_runner(), |
| 373 host_context_->ui_task_runner()); |
| 372 host_->AddStatusObserver(this); | 374 host_->AddStatusObserver(this); |
| 373 log_to_server_.reset( | 375 log_to_server_.reset( |
| 374 new LogToServer(host_, ServerLogEntry::IT2ME, signal_strategy_.get())); | 376 new LogToServer(host_, ServerLogEntry::IT2ME, signal_strategy_.get())); |
| 375 | 377 |
| 376 // Disable audio by default. | 378 // Disable audio by default. |
| 377 // TODO(sergeyu): Add UI to enable it. | 379 // TODO(sergeyu): Add UI to enable it. |
| 378 scoped_ptr<protocol::CandidateSessionConfig> protocol_config = | 380 scoped_ptr<protocol::CandidateSessionConfig> protocol_config = |
| 379 protocol::CandidateSessionConfig::CreateDefault(); | 381 protocol::CandidateSessionConfig::CreateDefault(); |
| 380 protocol::CandidateSessionConfig::DisableAudioChannel(protocol_config.get()); | 382 protocol::CandidateSessionConfig::DisableAudioChannel(protocol_config.get()); |
| 381 host_->set_protocol_config(protocol_config.Pass()); | 383 host_->set_protocol_config(protocol_config.Pass()); |
| (...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1482 } | 1484 } |
| 1483 | 1485 |
| 1484 void HostNPScriptObject::SetException(const std::string& exception_string) { | 1486 void HostNPScriptObject::SetException(const std::string& exception_string) { |
| 1485 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); | 1487 DCHECK(plugin_task_runner_->BelongsToCurrentThread()); |
| 1486 | 1488 |
| 1487 g_npnetscape_funcs->setexception(parent_, exception_string.c_str()); | 1489 g_npnetscape_funcs->setexception(parent_, exception_string.c_str()); |
| 1488 LOG(INFO) << exception_string; | 1490 LOG(INFO) << exception_string; |
| 1489 } | 1491 } |
| 1490 | 1492 |
| 1491 } // namespace remoting | 1493 } // namespace remoting |
| OLD | NEW |