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

Unified Diff: remoting/host/client_session.cc

Issue 12544019: Create a desktop environment instance late so that it will see the curtain_required flag. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased on top of https://chromiumcodereview.appspot.com/12794004/ Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/client_session.cc
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc
index 11a380e89f2edc30329cdb1b1dbcf0eee12d1c27..48170d203de3e6581dfd4fa1a59ff284ea27edb1 100644
--- a/remoting/host/client_session.cc
+++ b/remoting/host/client_session.cc
@@ -48,12 +48,7 @@ ClientSession::ClientSession(
connection_(connection.Pass()),
connection_factory_(connection_.get()),
client_jid_(connection_->session()->jid()),
- // TODO(alexeypa): delay creation of |desktop_environment_| until
- // the curtain is enabled.
- desktop_environment_(desktop_environment_factory->Create(
- client_jid_,
- base::Bind(&protocol::ConnectionToClient::Disconnect,
- connection_factory_.GetWeakPtr()))),
+ desktop_environment_factory_(desktop_environment_factory),
input_tracker_(&host_input_filter_),
remote_input_filter_(&input_tracker_),
mouse_clamping_filter_(&remote_input_filter_),
@@ -159,11 +154,17 @@ void ClientSession::OnConnectionChannelsConnected(
DCHECK(!session_controller_);
DCHECK(!video_scheduler_);
+ scoped_ptr<DesktopEnvironment> desktop_environment =
+ desktop_environment_factory_->Create(
+ client_jid_,
+ base::Bind(&protocol::ConnectionToClient::Disconnect,
+ connection_factory_.GetWeakPtr()));
Wez 2013/03/14 04:15:54 ClientSession owns the DesktopEnvironment, so can'
alexeypa (please no reviews) 2013/03/14 19:09:06 No, we can't. The callback is passed to DesktopSes
Wez 2013/03/15 00:15:26 That feels like IpcDesktopEnvironment/DesktopSessi
+
// Create the session controller.
- session_controller_ = desktop_environment_->CreateSessionController();
+ session_controller_ = desktop_environment->CreateSessionController();
// Create and start the event executor.
- event_executor_ = desktop_environment_->CreateEventExecutor(
+ event_executor_ = desktop_environment->CreateEventExecutor(
input_task_runner_, ui_task_runner_);
event_executor_->Start(CreateClipboardProxy());
@@ -182,8 +183,8 @@ void ClientSession::OnConnectionChannelsConnected(
video_capture_task_runner_,
video_encode_task_runner_,
network_task_runner_,
- desktop_environment_->CreateVideoCapturer(video_capture_task_runner_,
- video_encode_task_runner_),
+ desktop_environment->CreateVideoCapturer(video_capture_task_runner_,
+ video_encode_task_runner_),
video_encoder.Pass(),
connection_->client_stub(),
&mouse_clamping_filter_);
@@ -195,7 +196,7 @@ void ClientSession::OnConnectionChannelsConnected(
audio_scheduler_ = AudioScheduler::Create(
audio_task_runner_,
network_task_runner_,
- desktop_environment_->CreateAudioCapturer(audio_task_runner_),
+ desktop_environment->CreateAudioCapturer(audio_task_runner_),
audio_encoder.Pass(),
connection_->audio_stub());
}

Powered by Google App Engine
This is Rietveld 408576698