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

Unified Diff: remoting/host/chromoting_host.cc

Issue 7867019: Access Session::config() and Session::jid() on the correct thread only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 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
« remoting/host/chromoting_host.h ('K') | « remoting/host/chromoting_host.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host.cc
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc
index 4b2ef5f22616a5eb3d3c4f191e27c30fab874667..87f652ef5b2046dd69f815e93164d8245f92b3c3 100644
--- a/remoting/host/chromoting_host.cc
+++ b/remoting/host/chromoting_host.cc
@@ -447,13 +447,18 @@ void ChromotingHost::EnableCurtainMode(bool enable) {
void ChromotingHost::LocalLoginSucceeded(
scoped_refptr<ConnectionToClient> connection) {
- if (MessageLoop::current() != context_->main_message_loop()) {
- context_->main_message_loop()->PostTask(
- FROM_HERE, base::Bind(&ChromotingHost::LocalLoginSucceeded, this,
- connection));
- return;
- }
+ DCHECK(context_->network_message_loop()->BelongsToCurrentThread());
+
+ context_->main_message_loop()->PostTask(
+ FROM_HERE, base::Bind(&ChromotingHost::HandleLocalLoginSucceeded,
+ this, connection, connection->session()->config(),
+ connection->session()->jid()));
Wez 2011/09/10 01:10:03 It seems kinda broken that we have to pull these o
+}
+void ChromotingHost::HandleLocalLoginSucceeded(
+ scoped_refptr<ConnectionToClient> connection,
+ const protocol::SessionConfig& config,
+ const std::string& jid) {
DCHECK_EQ(context_->main_message_loop(), MessageLoop::current());
protocol::LocalLoginStatus* status = new protocol::LocalLoginStatus();
@@ -479,7 +484,7 @@ void ChromotingHost::LocalLoginSucceeded(
if (!recorder_.get()) {
// Then we create a ScreenRecorder passing the message loops that
// it should run on.
- Encoder* encoder = CreateEncoder(connection->session()->config());
+ Encoder* encoder = CreateEncoder(config);
recorder_ = new ScreenRecorder(context_->main_message_loop(),
context_->encode_message_loop(),
@@ -500,7 +505,7 @@ void ChromotingHost::LocalLoginSucceeded(
// including closing the connection on failure of a critical operation.
EnableCurtainMode(true);
if (is_it2me_) {
- std::string username = connection->session()->jid();
+ std::string username = jid;
size_t pos = username.find('/');
if (pos != std::string::npos)
username.replace(pos, std::string::npos, "");
« remoting/host/chromoting_host.h ('K') | « remoting/host/chromoting_host.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698