OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_HOST_CLIENT_SESSION_H_ | 5 #ifndef REMOTING_HOST_CLIENT_SESSION_H_ |
6 #define REMOTING_HOST_CLIENT_SESSION_H_ | 6 #define REMOTING_HOST_CLIENT_SESSION_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "base/time.h" | 11 #include "base/time.h" |
12 #include "remoting/protocol/connection_to_client.h" | 12 #include "remoting/protocol/connection_to_client.h" |
13 #include "remoting/protocol/host_stub.h" | 13 #include "remoting/protocol/host_stub.h" |
14 #include "remoting/protocol/input_stub.h" | 14 #include "remoting/protocol/input_stub.h" |
15 #include "third_party/skia/include/core/SkPoint.h" | 15 #include "third_party/skia/include/core/SkPoint.h" |
16 | 16 |
17 namespace remoting { | 17 namespace remoting { |
18 | 18 |
19 class Capturer; | 19 class Capturer; |
20 | 20 |
21 // A ClientSession keeps a reference to a connection to a client, and maintains | 21 // A ClientSession keeps a reference to a connection to a client, and maintains |
22 // per-client state. | 22 // per-client state. |
23 class ClientSession : public protocol::HostStub, | 23 class ClientSession : public protocol::HostStub, |
24 public protocol::InputStub, | 24 public protocol::InputStub, |
25 public protocol::ConnectionToClient::EventHandler, | 25 public protocol::ConnectionToClient::EventHandler, |
26 public base::RefCountedThreadSafe<ClientSession> { | 26 public base::RefCountedThreadSafe<ClientSession> { |
27 public: | 27 public: |
28 // Callback interface for passing events to the ChromotingHost. | 28 // Callback interface for passing events to the ChromotingHost. |
29 // Called only for external events, i.e. OnSessionClosed() is not | |
30 // called when Disconnect() is called. | |
31 class EventHandler { | 29 class EventHandler { |
32 public: | 30 public: |
33 virtual ~EventHandler() {} | 31 virtual ~EventHandler() {} |
34 | 32 |
35 virtual void OnSessionAuthenticated(ClientSession* client) = 0; | 33 virtual void OnSessionAuthenticated(ClientSession* client) = 0; |
36 virtual void OnSessionClosed(ClientSession* client) = 0; | 34 virtual void OnSessionClosed(ClientSession* client) = 0; |
37 virtual void OnSessionSequenceNumber(ClientSession* client, | 35 virtual void OnSessionSequenceNumber(ClientSession* client, |
38 int64 sequence_number) = 0; | 36 int64 sequence_number) = 0; |
39 }; | 37 }; |
40 | 38 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // Set of keys that are currently pressed down by the user. This is used so | 139 // Set of keys that are currently pressed down by the user. This is used so |
142 // we can release them if the user disconnects. | 140 // we can release them if the user disconnects. |
143 std::set<int> pressed_keys_; | 141 std::set<int> pressed_keys_; |
144 | 142 |
145 DISALLOW_COPY_AND_ASSIGN(ClientSession); | 143 DISALLOW_COPY_AND_ASSIGN(ClientSession); |
146 }; | 144 }; |
147 | 145 |
148 } // namespace remoting | 146 } // namespace remoting |
149 | 147 |
150 #endif // REMOTING_HOST_CLIENT_SESSION_H_ | 148 #endif // REMOTING_HOST_CLIENT_SESSION_H_ |
OLD | NEW |