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

Unified Diff: remoting/host/client_session.cc

Issue 8495024: Access ChromotingHost::clients_ only on network thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 1 month 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
« no previous file with comments | « remoting/host/client_session.h ('k') | remoting/host/client_session_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/client_session.cc
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc
index d59c3a61b75c54b3856b87f4d3061f019b413fe2..9baf6f7d58d2b802054ebbd4194bf4188662d209 100644
--- a/remoting/host/client_session.cc
+++ b/remoting/host/client_session.cc
@@ -101,7 +101,6 @@ void ClientSession::OnConnectionClosed(
DCHECK_EQ(connection_.get(), connection);
scoped_refptr<ClientSession> self = this;
event_handler_->OnSessionClosed(this);
- Disconnect();
}
void ClientSession::OnConnectionFailed(
@@ -110,7 +109,6 @@ void ClientSession::OnConnectionFailed(
// TODO(sergeyu): Log failure reason?
scoped_refptr<ClientSession> self = this;
event_handler_->OnSessionClosed(this);
- Disconnect();
}
void ClientSession::OnSequenceNumberUpdated(
@@ -120,9 +118,13 @@ void ClientSession::OnSequenceNumberUpdated(
}
void ClientSession::Disconnect() {
- connection_->Disconnect();
+ DCHECK(connection_);
authenticated_ = false;
RestoreEventState();
+
+ // This triggers OnSessionClosed() and the session may be destroyed
+ // as the result, so this call must be the last in this method.
+ connection_->Disconnect();
}
void ClientSession::LocalMouseMoved(const SkIPoint& mouse_pos) {
« no previous file with comments | « remoting/host/client_session.h ('k') | remoting/host/client_session_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698