diff options
author | simonmorris@chromium.org <simonmorris@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-23 12:13:35 +0000 |
---|---|---|
committer | simonmorris@chromium.org <simonmorris@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-23 12:13:35 +0000 |
commit | 44f6076044d0936eb3ab7394faaee1f48e6bef9b (patch) | |
tree | 0e92bca8141edd9cb00032a40857535b1ad4b9b2 /remoting/host/chromoting_host.h | |
parent | 8bb846f9fa618c1975638a49c3be7ec61f304d13 (diff) | |
download | chromium_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/chromoting_host.h')
-rw-r--r-- | remoting/host/chromoting_host.h | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/remoting/host/chromoting_host.h b/remoting/host/chromoting_host.h index fc6daaf..f754c27 100644 --- a/remoting/host/chromoting_host.h +++ b/remoting/host/chromoting_host.h @@ -12,6 +12,7 @@ #include "remoting/base/encoder.h" #include "remoting/host/access_verifier.h" #include "remoting/host/capturer.h" +#include "remoting/host/client_session.h" #include "remoting/host/desktop_environment.h" #include "remoting/host/heartbeat_sender.h" #include "remoting/jingle_glue/jingle_client.h" @@ -63,7 +64,7 @@ class ScreenRecorder; // incoming connection. class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>, public protocol::ConnectionToClient::EventHandler, - public DesktopEnvironment::EventHandler, + public ClientSession::EventHandler, public JingleClient::Callback { public: // Factory methods that must be used to create ChromotingHost instances. @@ -105,9 +106,11 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>, virtual void OnStateChange(JingleClient* client, JingleClient::State state); //////////////////////////////////////////////////////////////////////////// - // DesktopEnvironment::EventHandler implementations - virtual void LocalLoginSucceeded(); - virtual void LocalLoginFailed(); + // ClientSession::EventHandler implementations + virtual void LocalLoginSucceeded( + scoped_refptr<protocol::ConnectionToClient> client); + virtual void LocalLoginFailed( + scoped_refptr<protocol::ConnectionToClient> client); // Callback for ChromotingServer. void OnNewClientSession( @@ -118,13 +121,8 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>, // |config| is transferred to the object. Must be called before Start(). void set_protocol_config(protocol::CandidateSessionConfig* config); - // This getter is only used in unit test. - protocol::HostStub* host_stub() const; - // This setter is only used in unit test to simulate client connection. - void set_connection(protocol::ConnectionToClient* conn) { - connection_ = conn; - } + void AddClient(ClientSession* client); private: friend class base::RefCountedThreadSafe<ChromotingHost>; @@ -167,9 +165,8 @@ class ChromotingHost : public base::RefCountedThreadSafe<ChromotingHost>, AccessVerifier access_verifier_; - // A ConnectionToClient manages the connectino to a remote client. - // TODO(hclam): Expand this to a list of clients. - scoped_refptr<protocol::ConnectionToClient> connection_; + // The connections to remote clients. + std::vector<scoped_refptr<ClientSession> > clients_; // Session manager for the host process. scoped_refptr<ScreenRecorder> recorder_; |