| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 ClientSession* client, | 79 ClientSession* client, |
| 80 const std::string& channel_name, | 80 const std::string& channel_name, |
| 81 const protocol::TransportRoute& route) = 0; | 81 const protocol::TransportRoute& route) = 0; |
| 82 | 82 |
| 83 protected: | 83 protected: |
| 84 virtual ~EventHandler() {} | 84 virtual ~EventHandler() {} |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 // |event_handler| and |desktop_environment_factory| must outlive |this|. | 87 // |event_handler| and |desktop_environment_factory| must outlive |this|. |
| 88 // All |HostExtension|s in |extensions| must outlive |this|. | 88 // All |HostExtension|s in |extensions| must outlive |this|. |
| 89 ClientSession( | 89 ClientSession(EventHandler* event_handler, |
| 90 EventHandler* event_handler, | 90 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, |
| 91 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner, | 91 scoped_ptr<protocol::ConnectionToClient> connection, |
| 92 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 92 DesktopEnvironmentFactory* desktop_environment_factory, |
| 93 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner, | 93 const base::TimeDelta& max_duration, |
| 94 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner, | 94 scoped_refptr<protocol::PairingRegistry> pairing_registry, |
| 95 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner, | 95 const std::vector<HostExtension*>& extensions); |
| 96 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | |
| 97 scoped_ptr<protocol::ConnectionToClient> connection, | |
| 98 DesktopEnvironmentFactory* desktop_environment_factory, | |
| 99 const base::TimeDelta& max_duration, | |
| 100 scoped_refptr<protocol::PairingRegistry> pairing_registry, | |
| 101 const std::vector<HostExtension*>& extensions); | |
| 102 ~ClientSession() override; | 96 ~ClientSession() override; |
| 103 | 97 |
| 104 // Returns the set of capabilities negotiated between client and host. | 98 // Returns the set of capabilities negotiated between client and host. |
| 105 const std::string& capabilities() const { return capabilities_; } | 99 const std::string& capabilities() const { return capabilities_; } |
| 106 | 100 |
| 107 // protocol::HostStub interface. | 101 // protocol::HostStub interface. |
| 108 void NotifyClientResolution( | 102 void NotifyClientResolution( |
| 109 const protocol::ClientResolution& resolution) override; | 103 const protocol::ClientResolution& resolution) override; |
| 110 void ControlVideo(const protocol::VideoControl& video_control) override; | 104 void ControlVideo(const protocol::VideoControl& video_control) override; |
| 111 void ControlAudio(const protocol::AudioControl& audio_control) override; | 105 void ControlAudio(const protocol::AudioControl& audio_control) override; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 190 |
| 197 // The maximum duration of this session. | 191 // The maximum duration of this session. |
| 198 // There is no maximum if this value is <= 0. | 192 // There is no maximum if this value is <= 0. |
| 199 base::TimeDelta max_duration_; | 193 base::TimeDelta max_duration_; |
| 200 | 194 |
| 201 // A timer that triggers a disconnect when the maximum session duration | 195 // A timer that triggers a disconnect when the maximum session duration |
| 202 // is reached. | 196 // is reached. |
| 203 base::OneShotTimer max_duration_timer_; | 197 base::OneShotTimer max_duration_timer_; |
| 204 | 198 |
| 205 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; | 199 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner_; |
| 206 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner_; | |
| 207 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner_; | |
| 208 scoped_refptr<base::SingleThreadTaskRunner> video_encode_task_runner_; | |
| 209 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner_; | |
| 210 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; | |
| 211 | 200 |
| 212 // Objects responsible for sending video, audio and mouse shape. | 201 // Objects responsible for sending video, audio and mouse shape. |
| 213 // |video_stream_| and |mouse_shape_pump_| may be nullptr if the video | 202 // |video_stream_| and |mouse_shape_pump_| may be nullptr if the video |
| 214 // stream is handled by an extension, see ResetVideoPipeline(). | 203 // stream is handled by an extension, see ResetVideoPipeline(). |
| 215 scoped_ptr<AudioPump> audio_pump_; | 204 scoped_ptr<AudioPump> audio_pump_; |
| 216 scoped_ptr<protocol::VideoStream> video_stream_; | 205 scoped_ptr<protocol::VideoStream> video_stream_; |
| 217 scoped_ptr<MouseShapePump> mouse_shape_pump_; | 206 scoped_ptr<MouseShapePump> mouse_shape_pump_; |
| 218 | 207 |
| 219 // The set of all capabilities supported by the client. | 208 // The set of all capabilities supported by the client. |
| 220 scoped_ptr<std::string> client_capabilities_; | 209 scoped_ptr<std::string> client_capabilities_; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 251 // Used to disable callbacks to |this| once DisconnectSession() has been | 240 // Used to disable callbacks to |this| once DisconnectSession() has been |
| 252 // called. | 241 // called. |
| 253 base::WeakPtrFactory<ClientSessionControl> weak_factory_; | 242 base::WeakPtrFactory<ClientSessionControl> weak_factory_; |
| 254 | 243 |
| 255 DISALLOW_COPY_AND_ASSIGN(ClientSession); | 244 DISALLOW_COPY_AND_ASSIGN(ClientSession); |
| 256 }; | 245 }; |
| 257 | 246 |
| 258 } // namespace remoting | 247 } // namespace remoting |
| 259 | 248 |
| 260 #endif // REMOTING_HOST_CLIENT_SESSION_H_ | 249 #endif // REMOTING_HOST_CLIENT_SESSION_H_ |
| OLD | NEW |