| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 void It2MeHost::Connect() { | 70 void It2MeHost::Connect() { |
| 71 if (!host_context_->ui_task_runner()->BelongsToCurrentThread()) { | 71 if (!host_context_->ui_task_runner()->BelongsToCurrentThread()) { |
| 72 DCHECK(task_runner_->BelongsToCurrentThread()); | 72 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 73 host_context_->ui_task_runner()->PostTask( | 73 host_context_->ui_task_runner()->PostTask( |
| 74 FROM_HERE, base::Bind(&It2MeHost::Connect, this)); | 74 FROM_HERE, base::Bind(&It2MeHost::Connect, this)); |
| 75 return; | 75 return; |
| 76 } | 76 } |
| 77 | 77 |
| 78 desktop_environment_factory_.reset(new It2MeDesktopEnvironmentFactory( | 78 desktop_environment_factory_.reset(new It2MeDesktopEnvironmentFactory( |
| 79 host_context_->network_task_runner(), | 79 host_context_->network_task_runner(), |
| 80 host_context_->input_task_runner(), | 80 host_context_->video_capture_task_runner(), |
| 81 host_context_->ui_task_runner())); | 81 host_context_->input_task_runner(), host_context_->ui_task_runner())); |
| 82 | 82 |
| 83 // Start monitoring configured policies. | 83 // Start monitoring configured policies. |
| 84 policy_watcher_->StartWatching( | 84 policy_watcher_->StartWatching( |
| 85 base::Bind(&It2MeHost::OnPolicyUpdate, this), | 85 base::Bind(&It2MeHost::OnPolicyUpdate, this), |
| 86 base::Bind(&It2MeHost::OnPolicyError, this)); | 86 base::Bind(&It2MeHost::OnPolicyError, this)); |
| 87 | 87 |
| 88 // Switch to the network thread to start the actual connection. | 88 // Switch to the network thread to start the actual connection. |
| 89 host_context_->network_task_runner()->PostTask( | 89 host_context_->network_task_runner()->PostTask( |
| 90 FROM_HERE, base::Bind(&It2MeHost::ShowConfirmationPrompt, this)); | 90 FROM_HERE, base::Bind(&It2MeHost::ShowConfirmationPrompt, this)); |
| 91 } | 91 } |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 new protocol::JingleSessionManager(signal_strategy_.get())); | 248 new protocol::JingleSessionManager(signal_strategy_.get())); |
| 249 | 249 |
| 250 scoped_ptr<protocol::CandidateSessionConfig> protocol_config = | 250 scoped_ptr<protocol::CandidateSessionConfig> protocol_config = |
| 251 protocol::CandidateSessionConfig::CreateDefault(); | 251 protocol::CandidateSessionConfig::CreateDefault(); |
| 252 // Disable audio by default. | 252 // Disable audio by default. |
| 253 // TODO(sergeyu): Add UI to enable it. | 253 // TODO(sergeyu): Add UI to enable it. |
| 254 protocol_config->DisableAudioChannel(); | 254 protocol_config->DisableAudioChannel(); |
| 255 session_manager->set_protocol_config(std::move(protocol_config)); | 255 session_manager->set_protocol_config(std::move(protocol_config)); |
| 256 | 256 |
| 257 // Create the host. | 257 // Create the host. |
| 258 host_.reset(new ChromotingHost( | 258 host_.reset(new ChromotingHost(desktop_environment_factory_.get(), |
| 259 desktop_environment_factory_.get(), std::move(session_manager), | 259 std::move(session_manager), transport_context, |
| 260 transport_context, host_context_->audio_task_runner(), | 260 host_context_->audio_task_runner(), |
| 261 host_context_->input_task_runner(), | 261 host_context_->video_encode_task_runner())); |
| 262 host_context_->video_capture_task_runner(), | |
| 263 host_context_->video_encode_task_runner(), | |
| 264 host_context_->network_task_runner(), host_context_->ui_task_runner())); | |
| 265 host_->AddStatusObserver(this); | 262 host_->AddStatusObserver(this); |
| 266 host_status_logger_.reset( | 263 host_status_logger_.reset( |
| 267 new HostStatusLogger(host_->AsWeakPtr(), ServerLogEntry::IT2ME, | 264 new HostStatusLogger(host_->AsWeakPtr(), ServerLogEntry::IT2ME, |
| 268 signal_strategy_.get(), directory_bot_jid_)); | 265 signal_strategy_.get(), directory_bot_jid_)); |
| 269 | 266 |
| 270 // Create event logger. | 267 // Create event logger. |
| 271 host_event_logger_ = | 268 host_event_logger_ = |
| 272 HostEventLogger::Create(host_->AsWeakPtr(), kApplicationName); | 269 HostEventLogger::Create(host_->AsWeakPtr(), kApplicationName); |
| 273 | 270 |
| 274 // Connect signaling and start the host. | 271 // Connect signaling and start the host. |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( | 510 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( |
| 514 new It2MeConfirmationDialogFactory()); | 511 new It2MeConfirmationDialogFactory()); |
| 515 scoped_ptr<PolicyWatcher> policy_watcher = | 512 scoped_ptr<PolicyWatcher> policy_watcher = |
| 516 PolicyWatcher::Create(policy_service_, context->file_task_runner()); | 513 PolicyWatcher::Create(policy_service_, context->file_task_runner()); |
| 517 return new It2MeHost(std::move(context), std::move(policy_watcher), | 514 return new It2MeHost(std::move(context), std::move(policy_watcher), |
| 518 std::move(confirmation_dialog_factory), observer, | 515 std::move(confirmation_dialog_factory), observer, |
| 519 xmpp_server_config, directory_bot_jid); | 516 xmpp_server_config, directory_bot_jid); |
| 520 } | 517 } |
| 521 | 518 |
| 522 } // namespace remoting | 519 } // namespace remoting |
| OLD | NEW |