| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/it2me/it2me_host.h" | 5 #include "remoting/host/it2me/it2me_host.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 void It2MeHost::Connect() { | 69 void It2MeHost::Connect() { |
| 70 if (!host_context_->ui_task_runner()->BelongsToCurrentThread()) { | 70 if (!host_context_->ui_task_runner()->BelongsToCurrentThread()) { |
| 71 DCHECK(task_runner_->BelongsToCurrentThread()); | 71 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 72 host_context_->ui_task_runner()->PostTask( | 72 host_context_->ui_task_runner()->PostTask( |
| 73 FROM_HERE, base::Bind(&It2MeHost::Connect, this)); | 73 FROM_HERE, base::Bind(&It2MeHost::Connect, this)); |
| 74 return; | 74 return; |
| 75 } | 75 } |
| 76 | 76 |
| 77 desktop_environment_factory_.reset(new It2MeDesktopEnvironmentFactory( | 77 desktop_environment_factory_.reset(new It2MeDesktopEnvironmentFactory( |
| 78 host_context_->network_task_runner(), | 78 host_context_->network_task_runner(), |
| 79 host_context_->input_task_runner(), | 79 host_context_->video_capture_task_runner(), |
| 80 host_context_->ui_task_runner())); | 80 host_context_->input_task_runner(), host_context_->ui_task_runner())); |
| 81 | 81 |
| 82 // Start monitoring configured policies. | 82 // Start monitoring configured policies. |
| 83 policy_watcher_->StartWatching( | 83 policy_watcher_->StartWatching( |
| 84 base::Bind(&It2MeHost::OnPolicyUpdate, this), | 84 base::Bind(&It2MeHost::OnPolicyUpdate, this), |
| 85 base::Bind(&It2MeHost::OnPolicyError, this)); | 85 base::Bind(&It2MeHost::OnPolicyError, this)); |
| 86 | 86 |
| 87 // Switch to the network thread to start the actual connection. | 87 // Switch to the network thread to start the actual connection. |
| 88 host_context_->network_task_runner()->PostTask( | 88 host_context_->network_task_runner()->PostTask( |
| 89 FROM_HERE, base::Bind(&It2MeHost::ShowConfirmationPrompt, this)); | 89 FROM_HERE, base::Bind(&It2MeHost::ShowConfirmationPrompt, this)); |
| 90 } | 90 } |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 new protocol::JingleSessionManager(signal_strategy_.get())); | 246 new protocol::JingleSessionManager(signal_strategy_.get())); |
| 247 | 247 |
| 248 scoped_ptr<protocol::CandidateSessionConfig> protocol_config = | 248 scoped_ptr<protocol::CandidateSessionConfig> protocol_config = |
| 249 protocol::CandidateSessionConfig::CreateDefault(); | 249 protocol::CandidateSessionConfig::CreateDefault(); |
| 250 // Disable audio by default. | 250 // Disable audio by default. |
| 251 // TODO(sergeyu): Add UI to enable it. | 251 // TODO(sergeyu): Add UI to enable it. |
| 252 protocol_config->DisableAudioChannel(); | 252 protocol_config->DisableAudioChannel(); |
| 253 session_manager->set_protocol_config(std::move(protocol_config)); | 253 session_manager->set_protocol_config(std::move(protocol_config)); |
| 254 | 254 |
| 255 // Create the host. | 255 // Create the host. |
| 256 host_.reset(new ChromotingHost( | 256 host_.reset(new ChromotingHost(desktop_environment_factory_.get(), |
| 257 desktop_environment_factory_.get(), std::move(session_manager), | 257 std::move(session_manager), transport_context, |
| 258 transport_context, host_context_->audio_task_runner(), | 258 host_context_->audio_task_runner(), |
| 259 host_context_->input_task_runner(), | 259 host_context_->video_encode_task_runner())); |
| 260 host_context_->video_capture_task_runner(), | |
| 261 host_context_->video_encode_task_runner(), | |
| 262 host_context_->network_task_runner(), host_context_->ui_task_runner())); | |
| 263 host_->AddStatusObserver(this); | 260 host_->AddStatusObserver(this); |
| 264 host_status_logger_.reset( | 261 host_status_logger_.reset( |
| 265 new HostStatusLogger(host_->AsWeakPtr(), ServerLogEntry::IT2ME, | 262 new HostStatusLogger(host_->AsWeakPtr(), ServerLogEntry::IT2ME, |
| 266 signal_strategy_.get(), directory_bot_jid_)); | 263 signal_strategy_.get(), directory_bot_jid_)); |
| 267 | 264 |
| 268 // Create event logger. | 265 // Create event logger. |
| 269 host_event_logger_ = | 266 host_event_logger_ = |
| 270 HostEventLogger::Create(host_->AsWeakPtr(), kApplicationName); | 267 HostEventLogger::Create(host_->AsWeakPtr(), kApplicationName); |
| 271 | 268 |
| 272 // Connect signaling and start the host. | 269 // Connect signaling and start the host. |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( | 489 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( |
| 493 new It2MeConfirmationDialogFactory()); | 490 new It2MeConfirmationDialogFactory()); |
| 494 scoped_ptr<PolicyWatcher> policy_watcher = | 491 scoped_ptr<PolicyWatcher> policy_watcher = |
| 495 PolicyWatcher::Create(policy_service_, context->file_task_runner()); | 492 PolicyWatcher::Create(policy_service_, context->file_task_runner()); |
| 496 return new It2MeHost(std::move(context), std::move(policy_watcher), | 493 return new It2MeHost(std::move(context), std::move(policy_watcher), |
| 497 std::move(confirmation_dialog_factory), observer, | 494 std::move(confirmation_dialog_factory), observer, |
| 498 xmpp_server_config, directory_bot_jid); | 495 xmpp_server_config, directory_bot_jid); |
| 499 } | 496 } |
| 500 | 497 |
| 501 } // namespace remoting | 498 } // namespace remoting |
| OLD | NEW |