OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 // Called after connection has failed or after the client closed it. | 42 // Called after connection has failed or after the client closed it. |
43 virtual void OnSessionClosed(ClientSession* client) = 0; | 43 virtual void OnSessionClosed(ClientSession* client) = 0; |
44 | 44 |
45 // Called to notify of each message's sequence number. The | 45 // Called to notify of each message's sequence number. The |
46 // callback must not tear down this object. | 46 // callback must not tear down this object. |
47 virtual void OnSessionSequenceNumber(ClientSession* client, | 47 virtual void OnSessionSequenceNumber(ClientSession* client, |
48 int64 sequence_number) = 0; | 48 int64 sequence_number) = 0; |
49 | 49 |
50 // Called on notification of a route change event, when a channel is | 50 // Called on notification of a route change event, when a channel is |
51 // connected. | 51 // connected. |
52 virtual void OnSessionIpAddress(ClientSession* client, | 52 virtual void OnSessionRouteChange( |
53 const std::string& channel_name, | 53 ClientSession* client, |
54 const net::IPEndPoint& end_point) = 0; | 54 const std::string& channel_name, |
| 55 const net::IPEndPoint& remote_end_point, |
| 56 const net::IPEndPoint& local_end_point) = 0; |
55 }; | 57 }; |
56 | 58 |
57 // Takes ownership of |connection|. Does not take ownership of | 59 // Takes ownership of |connection|. Does not take ownership of |
58 // |event_handler|, |input_stub| or |capturer|. | 60 // |event_handler|, |input_stub| or |capturer|. |
59 ClientSession(EventHandler* event_handler, | 61 ClientSession(EventHandler* event_handler, |
60 protocol::ConnectionToClient* connection, | 62 protocol::ConnectionToClient* connection, |
61 protocol::InputStub* input_stub, | 63 protocol::InputStub* input_stub, |
62 Capturer* capturer); | 64 Capturer* capturer); |
63 virtual ~ClientSession(); | 65 virtual ~ClientSession(); |
64 | 66 |
65 // protocol::InputStub interface. | 67 // protocol::InputStub interface. |
66 virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE; | 68 virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE; |
67 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE; | 69 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE; |
68 | 70 |
69 // protocol::ConnectionToClient::EventHandler interface. | 71 // protocol::ConnectionToClient::EventHandler interface. |
70 virtual void OnConnectionOpened( | 72 virtual void OnConnectionOpened( |
71 protocol::ConnectionToClient* connection) OVERRIDE; | 73 protocol::ConnectionToClient* connection) OVERRIDE; |
72 virtual void OnConnectionClosed( | 74 virtual void OnConnectionClosed( |
73 protocol::ConnectionToClient* connection) OVERRIDE; | 75 protocol::ConnectionToClient* connection) OVERRIDE; |
74 virtual void OnConnectionFailed(protocol::ConnectionToClient* connection, | 76 virtual void OnConnectionFailed(protocol::ConnectionToClient* connection, |
75 protocol::Session::Error error) OVERRIDE; | 77 protocol::Session::Error error) OVERRIDE; |
76 virtual void OnSequenceNumberUpdated( | 78 virtual void OnSequenceNumberUpdated( |
77 protocol::ConnectionToClient* connection, int64 sequence_number) OVERRIDE; | 79 protocol::ConnectionToClient* connection, int64 sequence_number) OVERRIDE; |
78 virtual void OnClientIpAddress(protocol::ConnectionToClient* connection, | 80 virtual void OnRouteChange( |
79 const std::string& channel_name, | 81 protocol::ConnectionToClient* connection, |
80 const net::IPEndPoint& end_point) OVERRIDE; | 82 const std::string& channel_name, |
| 83 const net::IPEndPoint& remote_end_point, |
| 84 const net::IPEndPoint& local_end_point) OVERRIDE; |
81 | 85 |
82 // Disconnects the session and destroys the transport. Event handler | 86 // Disconnects the session and destroys the transport. Event handler |
83 // is guaranteed not to be called after this method is called. Can | 87 // is guaranteed not to be called after this method is called. Can |
84 // be called multiple times. The object should not be used after | 88 // be called multiple times. The object should not be used after |
85 // this method returns. | 89 // this method returns. |
86 void Disconnect(); | 90 void Disconnect(); |
87 | 91 |
88 protocol::ConnectionToClient* connection() const { | 92 protocol::ConnectionToClient* connection() const { |
89 return connection_.get(); | 93 return connection_.get(); |
90 } | 94 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // Set of keys that are currently pressed down by the user. This is used so | 163 // Set of keys that are currently pressed down by the user. This is used so |
160 // we can release them if the user disconnects. | 164 // we can release them if the user disconnects. |
161 std::set<int> pressed_keys_; | 165 std::set<int> pressed_keys_; |
162 | 166 |
163 DISALLOW_COPY_AND_ASSIGN(ClientSession); | 167 DISALLOW_COPY_AND_ASSIGN(ClientSession); |
164 }; | 168 }; |
165 | 169 |
166 } // namespace remoting | 170 } // namespace remoting |
167 | 171 |
168 #endif // REMOTING_HOST_CLIENT_SESSION_H_ | 172 #endif // REMOTING_HOST_CLIENT_SESSION_H_ |
OLD | NEW |