Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: remoting/host/it2me/it2me_host.cc

Issue 1545743002: Move ownership of Transport out of Session. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_not_pass_client
Patch Set: Created 4 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/threading/platform_thread.h" 10 #include "base/threading/platform_thread.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 nat_traversal_enabled_ ? 224 nat_traversal_enabled_ ?
225 protocol::NetworkSettings::NAT_TRAVERSAL_FULL : 225 protocol::NetworkSettings::NAT_TRAVERSAL_FULL :
226 protocol::NetworkSettings::NAT_TRAVERSAL_DISABLED); 226 protocol::NetworkSettings::NAT_TRAVERSAL_DISABLED);
227 if (!nat_traversal_enabled_) { 227 if (!nat_traversal_enabled_) {
228 network_settings.port_range.min_port = 228 network_settings.port_range.min_port =
229 protocol::NetworkSettings::kDefaultMinPort; 229 protocol::NetworkSettings::kDefaultMinPort;
230 network_settings.port_range.max_port = 230 network_settings.port_range.max_port =
231 protocol::NetworkSettings::kDefaultMaxPort; 231 protocol::NetworkSettings::kDefaultMaxPort;
232 } 232 }
233 233
234 scoped_ptr<protocol::TransportFactory> transport_factory( 234 scoped_refptr<protocol::TransportContext> transport_context =
235 new protocol::IceTransportFactory(new protocol::TransportContext( 235 new protocol::TransportContext(
236 signal_strategy_.get(), 236 signal_strategy_.get(),
237 make_scoped_ptr(new protocol::ChromiumPortAllocatorFactory( 237 make_scoped_ptr(new protocol::ChromiumPortAllocatorFactory(
238 host_context_->url_request_context_getter())), 238 host_context_->url_request_context_getter())),
239 network_settings, protocol::TransportRole::SERVER))); 239 network_settings, protocol::TransportRole::SERVER);
240 240
241 scoped_ptr<protocol::SessionManager> session_manager( 241 scoped_ptr<protocol::SessionManager> session_manager(
242 new protocol::JingleSessionManager(std::move(transport_factory), 242 new protocol::JingleSessionManager(signal_strategy.get()));
243 signal_strategy.get()));
244 243
245 scoped_ptr<protocol::CandidateSessionConfig> protocol_config = 244 scoped_ptr<protocol::CandidateSessionConfig> protocol_config =
246 protocol::CandidateSessionConfig::CreateDefault(); 245 protocol::CandidateSessionConfig::CreateDefault();
247 // Disable audio by default. 246 // Disable audio by default.
248 // TODO(sergeyu): Add UI to enable it. 247 // TODO(sergeyu): Add UI to enable it.
249 protocol_config->DisableAudioChannel(); 248 protocol_config->DisableAudioChannel();
250 session_manager->set_protocol_config(std::move(protocol_config)); 249 session_manager->set_protocol_config(std::move(protocol_config));
251 250
252 // Create the host. 251 // Create the host.
253 host_.reset(new ChromotingHost( 252 host_.reset(new ChromotingHost(
254 desktop_environment_factory_.get(), std::move(session_manager), 253 desktop_environment_factory_.get(), std::move(session_manager),
255 host_context_->audio_task_runner(), host_context_->input_task_runner(), 254 transport_context, host_context_->audio_task_runner(),
255 host_context_->input_task_runner(),
256 host_context_->video_capture_task_runner(), 256 host_context_->video_capture_task_runner(),
257 host_context_->video_encode_task_runner(), 257 host_context_->video_encode_task_runner(),
258 host_context_->network_task_runner(), host_context_->ui_task_runner())); 258 host_context_->network_task_runner(), host_context_->ui_task_runner()));
259 host_->AddStatusObserver(this); 259 host_->AddStatusObserver(this);
260 host_status_logger_.reset( 260 host_status_logger_.reset(
261 new HostStatusLogger(host_->AsWeakPtr(), ServerLogEntry::IT2ME, 261 new HostStatusLogger(host_->AsWeakPtr(), ServerLogEntry::IT2ME,
262 signal_strategy_.get(), directory_bot_jid_)); 262 signal_strategy_.get(), directory_bot_jid_));
263 263
264 // Create event logger. 264 // Create event logger.
265 host_event_logger_ = 265 host_event_logger_ =
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( 488 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory(
489 new It2MeConfirmationDialogFactory()); 489 new It2MeConfirmationDialogFactory());
490 scoped_ptr<PolicyWatcher> policy_watcher = 490 scoped_ptr<PolicyWatcher> policy_watcher =
491 PolicyWatcher::Create(policy_service_, context->file_task_runner()); 491 PolicyWatcher::Create(policy_service_, context->file_task_runner());
492 return new It2MeHost(std::move(context), std::move(policy_watcher), 492 return new It2MeHost(std::move(context), std::move(policy_watcher),
493 std::move(confirmation_dialog_factory), observer, 493 std::move(confirmation_dialog_factory), observer,
494 xmpp_server_config, directory_bot_jid); 494 xmpp_server_config, directory_bot_jid);
495 } 495 }
496 496
497 } // namespace remoting 497 } // namespace remoting
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698