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

Unified Diff: remoting/host/client_session.cc

Issue 569593002: Maintaining the proper order of initialization WeakPtrFactory in "src/remoting" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 6 years, 3 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 e594b104cf63674e83ca7179ae35c5859ce751cd..5c4ed76d7902f2a24243e667a3190e61d2a53117 100644
--- a/remoting/host/client_session.cc
+++ b/remoting/host/client_session.cc
@@ -51,7 +51,6 @@ ClientSession::ClientSession(
: event_handler_(event_handler),
connection_(connection.Pass()),
client_jid_(connection_->session()->jid()),
- control_factory_(this),
desktop_environment_factory_(desktop_environment_factory),
input_tracker_(&host_input_filter_),
remote_input_filter_(&input_tracker_),
@@ -71,7 +70,8 @@ ClientSession::ClientSession(
pairing_registry_(pairing_registry),
pause_video_(false),
lossless_video_encode_(false),
- lossless_video_color_(false) {
+ lossless_video_color_(false),
+ weak_factory_(this) {
connection_->SetEventHandler(this);
// TODO(sergeyu): Currently ConnectionToClient expects stubs to be
@@ -281,7 +281,7 @@ void ClientSession::OnConnectionAuthenticated(
// Create the desktop environment. Drop the connection if it could not be
// created for any reason (for instance the curtain could not initialize).
desktop_environment_ =
- desktop_environment_factory_->Create(control_factory_.GetWeakPtr());
+ desktop_environment_factory_->Create(weak_factory_.GetWeakPtr());
if (!desktop_environment_) {
DisconnectSession();
return;
@@ -362,7 +362,7 @@ void ClientSession::OnConnectionClosed(
DCHECK_EQ(connection_.get(), connection);
// Ignore any further callbacks.
- control_factory_.InvalidateWeakPtrs();
+ weak_factory_.InvalidateWeakPtrs();
// If the client never authenticated then the session failed.
if (!auth_input_filter_.enabled())

Powered by Google App Engine
This is Rietveld 408576698