Chromium Code Reviews| 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, ""); |