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

Unified Diff: remoting/protocol/connection_to_client.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_client.h ('k') | remoting/protocol/connection_to_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/connection_to_client.cc
diff --git a/remoting/protocol/connection_to_client.cc b/remoting/protocol/connection_to_client.cc
index 3b4bd3f21684e35bef56f69c552a46883ad4a9d6..383451b631506cac083654965624a6b1d1529b3c 100644
--- a/remoting/protocol/connection_to_client.cc
+++ b/remoting/protocol/connection_to_client.cc
@@ -8,6 +8,8 @@
#include "net/base/io_buffer.h"
#include "remoting/protocol/client_control_sender.h"
#include "remoting/protocol/host_message_dispatcher.h"
+#include "remoting/protocol/host_stub.h"
+#include "remoting/protocol/input_stub.h"
// TODO(hclam): Remove this header once MessageDispatcher is used.
#include "remoting/base/compound_buffer.h"
@@ -23,7 +25,8 @@ ConnectionToClient::ConnectionToClient(MessageLoop* message_loop,
EventHandler* handler,
HostStub* host_stub,
InputStub* input_stub)
- : loop_(message_loop),
+ : client_authenticated_(false),
+ loop_(message_loop),
handler_(handler),
host_stub_(host_stub),
input_stub_(input_stub) {
@@ -73,9 +76,6 @@ ClientStub* ConnectionToClient::client_stub() {
return client_stub_.get();
}
-ConnectionToClient::ConnectionToClient() {
-}
-
void ConnectionToClient::OnSessionStateChange(protocol::Session::State state) {
if (state == protocol::Session::CONNECTED) {
client_stub_.reset(new ClientControlSender(session_->control_channel()));
@@ -123,5 +123,17 @@ void ConnectionToClient::StateChangeTask(protocol::Session::State state) {
void ConnectionToClient::OnClosed() {
}
+void ConnectionToClient::OnClientAuthenticated() {
+ client_authenticated_ = true;
+
+ // Enable/disable each of the channels.
+ if (input_stub_)
+ input_stub_->OnAuthenticated();
+ if (host_stub_)
+ host_stub_->OnAuthenticated();
+ if (client_stub_.get())
+ client_stub_->OnAuthenticated();
+}
+
} // namespace protocol
} // namespace remoting
« no previous file with comments | « remoting/protocol/connection_to_client.h ('k') | remoting/protocol/connection_to_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698