| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 const protocol::TransportRoute& route) = 0; | 80 const protocol::TransportRoute& route) = 0; |
| 81 | 81 |
| 82 protected: | 82 protected: |
| 83 virtual ~EventHandler() {} | 83 virtual ~EventHandler() {} |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 // |event_handler| and |desktop_environment_factory| must outlive |this|. | 86 // |event_handler| and |desktop_environment_factory| must outlive |this|. |
| 87 // All |HostExtension|s in |extensions| must outlive |this|. | 87 // All |HostExtension|s in |extensions| must outlive |this|. |
| 88 ClientSession(EventHandler* event_handler, | 88 ClientSession(EventHandler* event_handler, |
| 89 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, | 89 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, |
| 90 scoped_ptr<protocol::ConnectionToClient> connection, | 90 std::unique_ptr<protocol::ConnectionToClient> connection, |
| 91 DesktopEnvironmentFactory* desktop_environment_factory, | 91 DesktopEnvironmentFactory* desktop_environment_factory, |
| 92 const base::TimeDelta& max_duration, | 92 const base::TimeDelta& max_duration, |
| 93 scoped_refptr<protocol::PairingRegistry> pairing_registry, | 93 scoped_refptr<protocol::PairingRegistry> pairing_registry, |
| 94 const std::vector<HostExtension*>& extensions); | 94 const std::vector<HostExtension*>& extensions); |
| 95 ~ClientSession() override; | 95 ~ClientSession() override; |
| 96 | 96 |
| 97 // Returns the set of capabilities negotiated between client and host. | 97 // Returns the set of capabilities negotiated between client and host. |
| 98 const std::string& capabilities() const { return capabilities_; } | 98 const std::string& capabilities() const { return capabilities_; } |
| 99 | 99 |
| 100 // protocol::HostStub interface. | 100 // protocol::HostStub interface. |
| (...skipping 30 matching lines...) Expand all Loading... |
| 131 protocol::ConnectionToClient* connection() const { return connection_.get(); } | 131 protocol::ConnectionToClient* connection() const { return connection_.get(); } |
| 132 | 132 |
| 133 bool is_authenticated() { return is_authenticated_; } | 133 bool is_authenticated() { return is_authenticated_; } |
| 134 | 134 |
| 135 const std::string* client_capabilities() const { | 135 const std::string* client_capabilities() const { |
| 136 return client_capabilities_.get(); | 136 return client_capabilities_.get(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 private: | 139 private: |
| 140 // Creates a proxy for sending clipboard events to the client. | 140 // Creates a proxy for sending clipboard events to the client. |
| 141 scoped_ptr<protocol::ClipboardStub> CreateClipboardProxy(); | 141 std::unique_ptr<protocol::ClipboardStub> CreateClipboardProxy(); |
| 142 | 142 |
| 143 void OnScreenSizeChanged(const webrtc::DesktopSize& size, | 143 void OnScreenSizeChanged(const webrtc::DesktopSize& size, |
| 144 const webrtc::DesktopVector& dpi); | 144 const webrtc::DesktopVector& dpi); |
| 145 | 145 |
| 146 EventHandler* event_handler_; | 146 EventHandler* event_handler_; |
| 147 | 147 |
| 148 // The connection to the client. | 148 // The connection to the client. |
| 149 scoped_ptr<protocol::ConnectionToClient> connection_; | 149 std::unique_ptr<protocol::ConnectionToClient> connection_; |
| 150 | 150 |
| 151 std::string client_jid_; | 151 std::string client_jid_; |
| 152 | 152 |
| 153 // Used to create a DesktopEnvironment instance for this session. | 153 // Used to create a DesktopEnvironment instance for this session. |
| 154 DesktopEnvironmentFactory* desktop_environment_factory_; | 154 DesktopEnvironmentFactory* desktop_environment_factory_; |
| 155 | 155 |
| 156 // The DesktopEnvironment instance for this session. | 156 // The DesktopEnvironment instance for this session. |
| 157 scoped_ptr<DesktopEnvironment> desktop_environment_; | 157 std::unique_ptr<DesktopEnvironment> desktop_environment_; |
| 158 | 158 |
| 159 // Filter used as the final element in the input pipeline. | 159 // Filter used as the final element in the input pipeline. |
| 160 protocol::InputFilter host_input_filter_; | 160 protocol::InputFilter host_input_filter_; |
| 161 | 161 |
| 162 // Tracker used to release pressed keys and buttons when disconnecting. | 162 // Tracker used to release pressed keys and buttons when disconnecting. |
| 163 protocol::InputEventTracker input_tracker_; | 163 protocol::InputEventTracker input_tracker_; |
| 164 | 164 |
| 165 // Filter used to disable remote inputs during local input activity. | 165 // Filter used to disable remote inputs during local input activity. |
| 166 RemoteInputFilter remote_input_filter_; | 166 RemoteInputFilter remote_input_filter_; |
| 167 | 167 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 186 // There is no maximum if this value is <= 0. | 186 // There is no maximum if this value is <= 0. |
| 187 base::TimeDelta max_duration_; | 187 base::TimeDelta max_duration_; |
| 188 | 188 |
| 189 // A timer that triggers a disconnect when the maximum session duration | 189 // A timer that triggers a disconnect when the maximum session duration |
| 190 // is reached. | 190 // is reached. |
| 191 base::OneShotTimer max_duration_timer_; | 191 base::OneShotTimer max_duration_timer_; |
| 192 | 192 |
| 193 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; | 193 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; |
| 194 | 194 |
| 195 // Objects responsible for sending video, audio and mouse shape. | 195 // Objects responsible for sending video, audio and mouse shape. |
| 196 scoped_ptr<AudioPump> audio_pump_; | 196 std::unique_ptr<AudioPump> audio_pump_; |
| 197 scoped_ptr<protocol::VideoStream> video_stream_; | 197 std::unique_ptr<protocol::VideoStream> video_stream_; |
| 198 scoped_ptr<MouseShapePump> mouse_shape_pump_; | 198 std::unique_ptr<MouseShapePump> mouse_shape_pump_; |
| 199 | 199 |
| 200 // The set of all capabilities supported by the client. | 200 // The set of all capabilities supported by the client. |
| 201 scoped_ptr<std::string> client_capabilities_; | 201 std::unique_ptr<std::string> client_capabilities_; |
| 202 | 202 |
| 203 // The set of all capabilities supported by the host. | 203 // The set of all capabilities supported by the host. |
| 204 std::string host_capabilities_; | 204 std::string host_capabilities_; |
| 205 | 205 |
| 206 // The set of all capabilities negotiated between client and host. | 206 // The set of all capabilities negotiated between client and host. |
| 207 std::string capabilities_; | 207 std::string capabilities_; |
| 208 | 208 |
| 209 // Used to inject mouse and keyboard input and handle clipboard events. | 209 // Used to inject mouse and keyboard input and handle clipboard events. |
| 210 scoped_ptr<InputInjector> input_injector_; | 210 std::unique_ptr<InputInjector> input_injector_; |
| 211 | 211 |
| 212 // Used to apply client-requested changes in screen resolution. | 212 // Used to apply client-requested changes in screen resolution. |
| 213 scoped_ptr<ScreenControls> screen_controls_; | 213 std::unique_ptr<ScreenControls> screen_controls_; |
| 214 | 214 |
| 215 // The pairing registry for PIN-less authentication. | 215 // The pairing registry for PIN-less authentication. |
| 216 scoped_refptr<protocol::PairingRegistry> pairing_registry_; | 216 scoped_refptr<protocol::PairingRegistry> pairing_registry_; |
| 217 | 217 |
| 218 // Used to manage extension functionality. | 218 // Used to manage extension functionality. |
| 219 scoped_ptr<HostExtensionSessionManager> extension_manager_; | 219 std::unique_ptr<HostExtensionSessionManager> extension_manager_; |
| 220 | 220 |
| 221 // Set to true if the client was authenticated successfully. | 221 // Set to true if the client was authenticated successfully. |
| 222 bool is_authenticated_; | 222 bool is_authenticated_; |
| 223 | 223 |
| 224 // Used to store video channel pause & lossless parameters. | 224 // Used to store video channel pause & lossless parameters. |
| 225 bool pause_video_; | 225 bool pause_video_; |
| 226 bool lossless_video_encode_; | 226 bool lossless_video_encode_; |
| 227 bool lossless_video_color_; | 227 bool lossless_video_color_; |
| 228 | 228 |
| 229 // Used to disable callbacks to |this| once DisconnectSession() has been | 229 // Used to disable callbacks to |this| once DisconnectSession() has been |
| 230 // called. | 230 // called. |
| 231 base::WeakPtrFactory<ClientSessionControl> weak_factory_; | 231 base::WeakPtrFactory<ClientSessionControl> weak_factory_; |
| 232 | 232 |
| 233 DISALLOW_COPY_AND_ASSIGN(ClientSession); | 233 DISALLOW_COPY_AND_ASSIGN(ClientSession); |
| 234 }; | 234 }; |
| 235 | 235 |
| 236 } // namespace remoting | 236 } // namespace remoting |
| 237 | 237 |
| 238 #endif // REMOTING_HOST_CLIENT_SESSION_H_ | 238 #endif // REMOTING_HOST_CLIENT_SESSION_H_ |
| OLD | NEW |