summaryrefslogtreecommitdiffstats
path: root/remoting/host/desktop_environment.cc
diff options
context:
space:
mode:
authorsimonmorris@chromium.org <simonmorris@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-23 12:13:35 +0000
committersimonmorris@chromium.org <simonmorris@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-23 12:13:35 +0000
commit44f6076044d0936eb3ab7394faaee1f48e6bef9b (patch)
tree0e92bca8141edd9cb00032a40857535b1ad4b9b2 /remoting/host/desktop_environment.cc
parent8bb846f9fa618c1975638a49c3be7ec61f304d13 (diff)
downloadchromium_src-44f6076044d0936eb3ab7394faaee1f48e6bef9b.zip
chromium_src-44f6076044d0936eb3ab7394faaee1f48e6bef9b.tar.gz
chromium_src-44f6076044d0936eb3ab7394faaee1f48e6bef9b.tar.bz2
ChromotingHost can have multiple connections, but only one
authenticated connection. When a connection is authenticated, the host disconnects all other connections. The result is that if a client has disconnected without the host noticing, another client can connect immediately, without having to wait for the older connection to time out. The new ClientSession class encapsulates a ConnectionToClient and per-client state. It has taken the HostStub implementation away from DesktopEnvironment. BUG=70013 TEST=extra unit test; also see repro steps in BUG Review URL: http://codereview.chromium.org/6711033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79114 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/host/desktop_environment.cc')
-rw-r--r--remoting/host/desktop_environment.cc41
1 files changed, 1 insertions, 40 deletions
diff --git a/remoting/host/desktop_environment.cc b/remoting/host/desktop_environment.cc
index e6e1057..edc1792 100644
--- a/remoting/host/desktop_environment.cc
+++ b/remoting/host/desktop_environment.cc
@@ -5,10 +5,6 @@
#include "remoting/host/desktop_environment.h"
#include "remoting/host/capturer.h"
-#include "remoting/host/chromoting_host.h"
-#include "remoting/host/user_authenticator.h"
-#include "remoting/proto/auth.pb.h"
-#include "remoting/protocol/client_stub.h"
#include "remoting/protocol/input_stub.h"
using remoting::protocol::InputStub;
@@ -17,46 +13,11 @@ namespace remoting {
DesktopEnvironment::DesktopEnvironment(Capturer* capturer,
InputStub* input_stub)
- : event_handler_(NULL),
- capturer_(capturer),
+ : capturer_(capturer),
input_stub_(input_stub) {
}
DesktopEnvironment::~DesktopEnvironment() {
}
-void DesktopEnvironment::SuggestResolution(
- const protocol::SuggestResolutionRequest* msg, Task* done) {
- done->Run();
- delete done;
-}
-
-void DesktopEnvironment::BeginSessionRequest(
- const protocol::LocalLoginCredentials* credentials, Task* done) {
- DCHECK(event_handler_);
-
- bool success = false;
- scoped_ptr<UserAuthenticator> authenticator(UserAuthenticator::Create());
- switch (credentials->type()) {
- case protocol::PASSWORD:
- success = authenticator->Authenticate(credentials->username(),
- credentials->credential());
- break;
-
- default:
- LOG(ERROR) << "Invalid credentials type " << credentials->type();
- break;
- }
-
- if (success) {
- event_handler_->LocalLoginSucceeded();
- } else {
- LOG(WARNING) << "Login failed for user " << credentials->username();
- event_handler_->LocalLoginFailed();
- }
-
- done->Run();
- delete done;
-}
-
} // namespace remoting