summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 17:14:45 +0000
committerlambroslambrou@chromium.org <lambroslambrou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 17:14:45 +0000
commitd870150e16f9791c235ee64d00c4549c23ab29a5 (patch)
treec0362be980fb2b76df4015d3b53ad9d4918c98c3
parentc2996a9124fa16f8b827ce370a840c2b3656e736 (diff)
downloadchromium_src-d870150e16f9791c235ee64d00c4549c23ab29a5.zip
chromium_src-d870150e16f9791c235ee64d00c4549c23ab29a5.tar.gz
chromium_src-d870150e16f9791c235ee64d00c4549c23ab29a5.tar.bz2
Clear authenticated state on client disconnection.
BUG=75553 TEST=Connect client to host, disconnect then connect again (after 2 minutes). Review URL: http://codereview.chromium.org/6684006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78046 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--remoting/protocol/client_stub.cc4
-rw-r--r--remoting/protocol/client_stub.h6
-rw-r--r--remoting/protocol/connection_to_client.cc10
-rw-r--r--remoting/protocol/host_stub.cc4
-rw-r--r--remoting/protocol/host_stub.h6
-rw-r--r--remoting/protocol/input_stub.cc4
-rw-r--r--remoting/protocol/input_stub.h6
7 files changed, 40 insertions, 0 deletions
diff --git a/remoting/protocol/client_stub.cc b/remoting/protocol/client_stub.cc
index d766f5b..cd5bf05 100644
--- a/remoting/protocol/client_stub.cc
+++ b/remoting/protocol/client_stub.cc
@@ -22,6 +22,10 @@ void ClientStub::OnAuthenticated() {
authenticated_ = true;
}
+void ClientStub::OnClosed() {
+ authenticated_ = false;
+}
+
bool ClientStub::authenticated() {
return authenticated_;
}
diff --git a/remoting/protocol/client_stub.h b/remoting/protocol/client_stub.h
index a2bd565..d6550ec 100644
--- a/remoting/protocol/client_stub.h
+++ b/remoting/protocol/client_stub.h
@@ -30,12 +30,18 @@ class ClientStub {
virtual void BeginSessionResponse(const LocalLoginStatus* msg,
Task* done) = 0;
+ // TODO(lambroslambrou): Remove OnAuthenticated() and OnClosed() when stubs
+ // are refactored not to store authentication state.
+
// Called when the client has authenticated with the host to enable the
// host->client control channel.
// Before this is called, only a limited set of control messages will be
// processed.
void OnAuthenticated();
+ // Called when the client is no longer connected.
+ void OnClosed();
+
// Has the client successfully authenticated with the host?
// I.e., should we be processing control events?
bool authenticated();
diff --git a/remoting/protocol/connection_to_client.cc b/remoting/protocol/connection_to_client.cc
index 383451b..11101cd 100644
--- a/remoting/protocol/connection_to_client.cc
+++ b/remoting/protocol/connection_to_client.cc
@@ -121,6 +121,16 @@ void ConnectionToClient::StateChangeTask(protocol::Session::State state) {
// OnClosed() is used as a callback for protocol::Session::Close().
void ConnectionToClient::OnClosed() {
+ client_authenticated_ = false;
+
+ // TODO(lambroslambrou): Remove these when stubs are refactored not to
+ // store authentication state.
+ if (input_stub_)
+ input_stub_->OnClosed();
+ if (host_stub_)
+ host_stub_->OnClosed();
+ if (client_stub_.get())
+ client_stub_->OnClosed();
}
void ConnectionToClient::OnClientAuthenticated() {
diff --git a/remoting/protocol/host_stub.cc b/remoting/protocol/host_stub.cc
index 3ab1029..6543652 100644
--- a/remoting/protocol/host_stub.cc
+++ b/remoting/protocol/host_stub.cc
@@ -21,6 +21,10 @@ void HostStub::OnAuthenticated() {
authenticated_ = true;
}
+void HostStub::OnClosed() {
+ authenticated_ = false;
+}
+
bool HostStub::authenticated() {
return authenticated_;
}
diff --git a/remoting/protocol/host_stub.h b/remoting/protocol/host_stub.h
index c8fa4ac..c4e9b46 100644
--- a/remoting/protocol/host_stub.h
+++ b/remoting/protocol/host_stub.h
@@ -29,12 +29,18 @@ class HostStub {
virtual void BeginSessionRequest(
const LocalLoginCredentials* credentials, Task* done) = 0;
+ // TODO(lambroslambrou): Remove OnAuthenticated() and OnClosed() when stubs
+ // are refactored not to store authentication state.
+
// Called when the client has authenticated with the host to enable the
// client->host control channel.
// Before this is called, only a limited set of control messages will be
// processed.
void OnAuthenticated();
+ // Called when the client is no longer connected.
+ void OnClosed();
+
// Has the client successfully authenticated with the host?
// I.e., should we be processing control events?
bool authenticated();
diff --git a/remoting/protocol/input_stub.cc b/remoting/protocol/input_stub.cc
index 8bb1ffb..a9e5427 100644
--- a/remoting/protocol/input_stub.cc
+++ b/remoting/protocol/input_stub.cc
@@ -21,6 +21,10 @@ void InputStub::OnAuthenticated() {
authenticated_ = true;
}
+void InputStub::OnClosed() {
+ authenticated_ = false;
+}
+
bool InputStub::authenticated() {
return authenticated_;
}
diff --git a/remoting/protocol/input_stub.h b/remoting/protocol/input_stub.h
index 8c80d16..0bc60c3 100644
--- a/remoting/protocol/input_stub.h
+++ b/remoting/protocol/input_stub.h
@@ -26,11 +26,17 @@ class InputStub {
virtual void InjectKeyEvent(const KeyEvent* event, Task* done) = 0;
virtual void InjectMouseEvent(const MouseEvent* event, Task* done) = 0;
+ // TODO(lambroslambrou): Remove OnAuthenticated() and OnClosed() when stubs
+ // are refactored not to store authentication state.
+
// Called when the client has authenticated with the host to enable the
// input event channel.
// Before this is called, all input event will be ignored.
void OnAuthenticated();
+ // Called when the client is no longer connected.
+ void OnClosed();
+
// Has the client successfully authenticated with the host?
// I.e., should we be processing input events?
bool authenticated();