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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 nat_traversal_enabled_ ? | 228 nat_traversal_enabled_ ? |
229 protocol::NetworkSettings::NAT_TRAVERSAL_FULL : | 229 protocol::NetworkSettings::NAT_TRAVERSAL_FULL : |
230 protocol::NetworkSettings::NAT_TRAVERSAL_DISABLED); | 230 protocol::NetworkSettings::NAT_TRAVERSAL_DISABLED); |
231 if (!nat_traversal_enabled_) { | 231 if (!nat_traversal_enabled_) { |
232 network_settings.port_range.min_port = | 232 network_settings.port_range.min_port = |
233 protocol::NetworkSettings::kDefaultMinPort; | 233 protocol::NetworkSettings::kDefaultMinPort; |
234 network_settings.port_range.max_port = | 234 network_settings.port_range.max_port = |
235 protocol::NetworkSettings::kDefaultMaxPort; | 235 protocol::NetworkSettings::kDefaultMaxPort; |
236 } | 236 } |
237 | 237 |
238 scoped_ptr<protocol::TransportFactory> transport_factory( | 238 scoped_refptr<protocol::TransportContext> transport_context = |
239 new protocol::IceTransportFactory(new protocol::TransportContext( | 239 new protocol::TransportContext( |
240 signal_strategy_.get(), | 240 signal_strategy_.get(), |
241 make_scoped_ptr(new protocol::ChromiumPortAllocatorFactory( | 241 make_scoped_ptr(new protocol::ChromiumPortAllocatorFactory( |
242 host_context_->url_request_context_getter())), | 242 host_context_->url_request_context_getter())), |
243 network_settings, protocol::TransportRole::SERVER))); | 243 network_settings, protocol::TransportRole::SERVER); |
244 | 244 |
245 scoped_ptr<protocol::SessionManager> session_manager( | 245 scoped_ptr<protocol::SessionManager> session_manager( |
246 new protocol::JingleSessionManager(std::move(transport_factory), | 246 new protocol::JingleSessionManager(signal_strategy.get())); |
247 signal_strategy.get())); | |
248 | 247 |
249 scoped_ptr<protocol::CandidateSessionConfig> protocol_config = | 248 scoped_ptr<protocol::CandidateSessionConfig> protocol_config = |
250 protocol::CandidateSessionConfig::CreateDefault(); | 249 protocol::CandidateSessionConfig::CreateDefault(); |
251 // Disable audio by default. | 250 // Disable audio by default. |
252 // TODO(sergeyu): Add UI to enable it. | 251 // TODO(sergeyu): Add UI to enable it. |
253 protocol_config->DisableAudioChannel(); | 252 protocol_config->DisableAudioChannel(); |
254 session_manager->set_protocol_config(std::move(protocol_config)); | 253 session_manager->set_protocol_config(std::move(protocol_config)); |
255 | 254 |
256 // Create the host. | 255 // Create the host. |
257 host_.reset(new ChromotingHost( | 256 host_.reset(new ChromotingHost( |
258 desktop_environment_factory_.get(), std::move(session_manager), | 257 desktop_environment_factory_.get(), std::move(session_manager), |
259 host_context_->audio_task_runner(), host_context_->input_task_runner(), | 258 transport_context, host_context_->audio_task_runner(), |
| 259 host_context_->input_task_runner(), |
260 host_context_->video_capture_task_runner(), | 260 host_context_->video_capture_task_runner(), |
261 host_context_->video_encode_task_runner(), | 261 host_context_->video_encode_task_runner(), |
262 host_context_->network_task_runner(), host_context_->ui_task_runner())); | 262 host_context_->network_task_runner(), host_context_->ui_task_runner())); |
263 host_->AddStatusObserver(this); | 263 host_->AddStatusObserver(this); |
264 host_status_logger_.reset( | 264 host_status_logger_.reset( |
265 new HostStatusLogger(host_->AsWeakPtr(), ServerLogEntry::IT2ME, | 265 new HostStatusLogger(host_->AsWeakPtr(), ServerLogEntry::IT2ME, |
266 signal_strategy_.get(), directory_bot_jid_)); | 266 signal_strategy_.get(), directory_bot_jid_)); |
267 | 267 |
268 // Create event logger. | 268 // Create event logger. |
269 host_event_logger_ = | 269 host_event_logger_ = |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( | 492 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( |
493 new It2MeConfirmationDialogFactory()); | 493 new It2MeConfirmationDialogFactory()); |
494 scoped_ptr<PolicyWatcher> policy_watcher = | 494 scoped_ptr<PolicyWatcher> policy_watcher = |
495 PolicyWatcher::Create(policy_service_, context->file_task_runner()); | 495 PolicyWatcher::Create(policy_service_, context->file_task_runner()); |
496 return new It2MeHost(std::move(context), std::move(policy_watcher), | 496 return new It2MeHost(std::move(context), std::move(policy_watcher), |
497 std::move(confirmation_dialog_factory), observer, | 497 std::move(confirmation_dialog_factory), observer, |
498 xmpp_server_config, directory_bot_jid); | 498 xmpp_server_config, directory_bot_jid); |
499 } | 499 } |
500 | 500 |
501 } // namespace remoting | 501 } // namespace remoting |
OLD | NEW |