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

Unified Diff: remoting/host/client_session.h

Issue 6711033: A new authenticated connection evicts an old one. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove redundant member of HostMessageDispatcher. Created 9 years, 9 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/host/client_session.h
diff --git a/remoting/host/client_session.h b/remoting/host/client_session.h
new file mode 100755
index 0000000000000000000000000000000000000000..06a079d4ab6e584eecd9d820c74432cdc471f29a
--- /dev/null
+++ b/remoting/host/client_session.h
@@ -0,0 +1,60 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef REMOTING_HOST_CLIENT_SESSION_H_
+#define REMOTING_HOST_CLIENT_SESSION_H_
+
+#include "remoting/protocol/connection_to_client.h"
+#include "remoting/protocol/host_stub.h"
+
+namespace remoting {
+
+// A ClientSession keeps a reference to a connection to a client, and maintains
+// per-client state.
+class ClientSession : public protocol::HostStub,
+ public base::RefCountedThreadSafe<ClientSession> {
+ public:
+ // Callback interface for passing events to the ChromotingHost.
+ class EventHandler {
+ public:
+ virtual ~EventHandler() {}
+
+ // Called to signal that local login has succeeded and ChromotingHost can
+ // proceed with the next step.
+ virtual void LocalLoginSucceeded(
+ scoped_refptr<protocol::ConnectionToClient> client) = 0;
+
+ // Called to signal that local login has failed.
+ virtual void LocalLoginFailed(
+ scoped_refptr<protocol::ConnectionToClient> client) = 0;
+ };
+
+ ClientSession(EventHandler* event_handler,
+ scoped_refptr<protocol::ConnectionToClient> connection);
+
+ // protocol::HostStub interface.
+ virtual void SuggestResolution(
+ const protocol::SuggestResolutionRequest* msg, Task* done);
+ virtual void BeginSessionRequest(
+ const protocol::LocalLoginCredentials* credentials, Task* done);
+
+ // Disconnect this client.
awong 2011/03/22 15:11:56 client -> Clientsession
simonmorris 2011/03/23 10:35:20 Done.
+ void Disconnect();
+
+ protocol::ConnectionToClient* connection();
awong 2011/03/22 15:11:56 make a const method?
simonmorris 2011/03/23 10:35:20 Done.
+
+ protected:
+ friend class base::RefCountedThreadSafe<ClientSession>;
+ ~ClientSession();
+
+ private:
+ EventHandler* event_handler_;
+ scoped_refptr<protocol::ConnectionToClient> connection_;
+
+ DISALLOW_COPY_AND_ASSIGN(ClientSession);
+};
+
+} // namespace remoting
+
+#endif // REMOTING_HOST_CLIENT_SESSION_H_

Powered by Google App Engine
This is Rietveld 408576698