Chromium Code Reviews| Index: remoting/host/chromoting_host.h |
| diff --git a/remoting/host/chromoting_host.h b/remoting/host/chromoting_host.h |
| index fc6daaf957acf4bea2ba89f3b3a6bccd952eb72e..26862b95199dc9657629ff13f474214bbda861db 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,12 +121,9 @@ 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 add_client(ClientSession* client) { |
|
awong
2011/03/22 15:11:56
Chromium style says, add_client() shoudl only be u
simonmorris
2011/03/23 10:35:20
Done.
|
| + clients_.push_back(client); |
| } |
| private: |
| @@ -167,9 +167,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_; |