diff options
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/host/chromoting_host.cc | 23 | ||||
-rw-r--r-- | remoting/host/chromoting_host.h | 5 | ||||
-rw-r--r-- | remoting/protocol/jingle_session.cc | 10 |
3 files changed, 16 insertions, 22 deletions
diff --git a/remoting/host/chromoting_host.cc b/remoting/host/chromoting_host.cc index 1b00087..8947a27 100644 --- a/remoting/host/chromoting_host.cc +++ b/remoting/host/chromoting_host.cc @@ -447,19 +447,12 @@ void ChromotingHost::EnableCurtainMode(bool enable) { void ChromotingHost::LocalLoginSucceeded( scoped_refptr<ConnectionToClient> connection) { - DCHECK(context_->network_message_loop()->BelongsToCurrentThread()); - - context_->main_message_loop()->PostTask( - FROM_HERE, base::Bind(&ChromotingHost::AddAuthenticatedClient, - this, connection, connection->session()->config(), - connection->session()->jid())); -} - -void ChromotingHost::AddAuthenticatedClient( - scoped_refptr<ConnectionToClient> connection, - const protocol::SessionConfig& config, - const std::string& jid) { - DCHECK_EQ(context_->main_message_loop(), MessageLoop::current()); + if (MessageLoop::current() != context_->main_message_loop()) { + context_->main_message_loop()->PostTask( + FROM_HERE, base::Bind(&ChromotingHost::LocalLoginSucceeded, this, + connection)); + return; + } protocol::LocalLoginStatus* status = new protocol::LocalLoginStatus(); status->set_success(true); @@ -484,7 +477,7 @@ void ChromotingHost::AddAuthenticatedClient( if (!recorder_.get()) { // Then we create a ScreenRecorder passing the message loops that // it should run on. - Encoder* encoder = CreateEncoder(config); + Encoder* encoder = CreateEncoder(connection->session()->config()); recorder_ = new ScreenRecorder(context_->main_message_loop(), context_->encode_message_loop(), @@ -505,7 +498,7 @@ void ChromotingHost::AddAuthenticatedClient( // including closing the connection on failure of a critical operation. EnableCurtainMode(true); if (is_it2me_) { - std::string username = jid; + std::string username = connection->session()->jid(); size_t pos = username.find('/'); if (pos != std::string::npos) username.replace(pos, std::string::npos, ""); diff --git a/remoting/host/chromoting_host.h b/remoting/host/chromoting_host.h index 3f34233..7b5cea5 100644 --- a/remoting/host/chromoting_host.h +++ b/remoting/host/chromoting_host.h @@ -125,11 +125,6 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>, protocol::Session* session, protocol::SessionManager::IncomingSessionResponse* response) OVERRIDE; - void AddAuthenticatedClient( - scoped_refptr<protocol::ConnectionToClient> connection, - const protocol::SessionConfig& config, - const std::string& jid); - // Sets desired configuration for the protocol. Ownership of the // |config| is transferred to the object. Must be called before Start(). void set_protocol_config(protocol::CandidateSessionConfig* config); diff --git a/remoting/protocol/jingle_session.cc b/remoting/protocol/jingle_session.cc index b30101c..b80239c 100644 --- a/remoting/protocol/jingle_session.cc +++ b/remoting/protocol/jingle_session.cc @@ -165,7 +165,10 @@ net::Socket* JingleSession::event_channel() { } const std::string& JingleSession::jid() { - DCHECK(CalledOnValidThread()); + // TODO(sergeyu): Fix ChromotingHost so that it doesn't call this + // method on invalid thread and uncomment this DCHECK. + // See crbug.com/88600 . + // DCHECK(CalledOnValidThread()); return jid_; } @@ -189,7 +192,10 @@ const std::string& JingleSession::local_certificate() const { } const SessionConfig& JingleSession::config() { - DCHECK(CalledOnValidThread()); + // TODO(sergeyu): Fix ChromotingHost so that it doesn't call this + // method on invalid thread and uncomment this DCHECK. + // See crbug.com/88600 . + // DCHECK(CalledOnValidThread()); DCHECK(config_set_); return config_; } |