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

Unified Diff: remoting/protocol/connection_to_host.cc

Issue 6594138: Block event processing on host/client until the client has authenticated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix merge conflict Created 9 years, 10 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
« no previous file with comments | « remoting/protocol/connection_to_host.h ('k') | remoting/protocol/host_message_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/connection_to_host.cc
diff --git a/remoting/protocol/connection_to_host.cc b/remoting/protocol/connection_to_host.cc
index 3d349976b417a5de3724487c7d44323cac1956e3..2ef3a229ed8368f7519abc9dada2c7f6c4f32ccb 100644
--- a/remoting/protocol/connection_to_host.cc
+++ b/remoting/protocol/connection_to_host.cc
@@ -25,7 +25,8 @@ ConnectionToHost::ConnectionToHost(
JingleThread* thread,
talk_base::NetworkManager* network_manager,
talk_base::PacketSocketFactory* socket_factory)
- : thread_(thread),
+ : client_authenticated_(false),
+ thread_(thread),
network_manager_(network_manager),
socket_factory_(socket_factory),
event_callback_(NULL),
@@ -190,7 +191,6 @@ void ConnectionToHost::OnSessionStateChange(
// Initialize reader and writer.
video_reader_.reset(VideoReader::Create(session_->config()));
video_reader_->Init(session_, video_stub_);
- input_stub_.reset(new InputSender(session_->event_channel()));
host_stub_.reset(new HostControlSender(session_->control_channel()));
dispatcher_->Initialize(session_.get(), client_stub_);
event_callback_->OnConnectionOpened(this);
@@ -202,5 +202,19 @@ void ConnectionToHost::OnSessionStateChange(
}
}
+void ConnectionToHost::OnClientAuthenticated() {
+ client_authenticated_ = true;
+
+ // Create and enable the input stub now that we're authenticated.
+ input_stub_.reset(new InputSender(session_->event_channel()));
+ input_stub_->OnAuthenticated();
+
+ // Enable control channel stubs.
+ if (host_stub_.get())
+ host_stub_->OnAuthenticated();
+ if (client_stub_)
+ client_stub_->OnAuthenticated();
+}
+
} // namespace protocol
} // namespace remoting
« no previous file with comments | « remoting/protocol/connection_to_host.h ('k') | remoting/protocol/host_message_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698