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

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 mock objects for unittests 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
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..5749a93fa99a8d48ba681292c9ffa8a280756378 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,8 +76,8 @@ ClientStub* ConnectionToClient::client_stub() {
return client_stub_.get();
}
-ConnectionToClient::ConnectionToClient() {
-}
+//ConnectionToClient::ConnectionToClient() {
dmac 2011/03/04 01:36:27 get rid of this then?
garykac 2011/03/04 05:33:24 oops
+//}
void ConnectionToClient::OnSessionStateChange(protocol::Session::State state) {
if (state == protocol::Session::CONNECTED) {
@@ -123,5 +126,17 @@ void ConnectionToClient::StateChangeTask(protocol::Session::State state) {
void ConnectionToClient::OnClosed() {
}
+void ConnectionToClient::SetClientAuthenticated(bool auth) {
+ client_authenticated_ = auth;
+
+ // Enable/disable each of the channels.
+ if (input_stub_)
+ input_stub_->SetEnable(auth);
+ if (host_stub_)
+ host_stub_->SetEnable(auth);
+ if(client_stub_.get())
+ client_stub_->SetEnable(auth);
+}
+
} // namespace protocol
} // namespace remoting

Powered by Google App Engine
This is Rietveld 408576698