Chromium Code Reviews| 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 <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 23 #include "remoting/protocol/clipboard_echo_filter.h" | 23 #include "remoting/protocol/clipboard_echo_filter.h" |
| 24 #include "remoting/protocol/clipboard_filter.h" | 24 #include "remoting/protocol/clipboard_filter.h" |
| 25 #include "remoting/protocol/clipboard_stub.h" | 25 #include "remoting/protocol/clipboard_stub.h" |
| 26 #include "remoting/protocol/connection_to_client.h" | 26 #include "remoting/protocol/connection_to_client.h" |
| 27 #include "remoting/protocol/host_stub.h" | 27 #include "remoting/protocol/host_stub.h" |
| 28 #include "remoting/protocol/input_event_tracker.h" | 28 #include "remoting/protocol/input_event_tracker.h" |
| 29 #include "remoting/protocol/input_filter.h" | 29 #include "remoting/protocol/input_filter.h" |
| 30 #include "remoting/protocol/input_stub.h" | 30 #include "remoting/protocol/input_stub.h" |
| 31 #include "remoting/protocol/pairing_registry.h" | 31 #include "remoting/protocol/pairing_registry.h" |
| 32 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | 32 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
| 33 #include "third_party/webrtc/modules/desktop_capture/screen_capturer.h" | |
| 33 | 34 |
| 34 namespace base { | 35 namespace base { |
| 35 class SingleThreadTaskRunner; | 36 class SingleThreadTaskRunner; |
| 36 } // namespace base | 37 } // namespace base |
| 37 | 38 |
| 38 namespace remoting { | 39 namespace remoting { |
| 39 | 40 |
| 40 class AudioEncoder; | 41 class AudioEncoder; |
| 41 class AudioScheduler; | 42 class AudioScheduler; |
| 42 class DesktopEnvironment; | 43 class DesktopEnvironment; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 protocol::ConnectionToClient* connection() const { | 159 protocol::ConnectionToClient* connection() const { |
| 159 return connection_.get(); | 160 return connection_.get(); |
| 160 } | 161 } |
| 161 | 162 |
| 162 bool is_authenticated() { return auth_input_filter_.enabled(); } | 163 bool is_authenticated() { return auth_input_filter_.enabled(); } |
| 163 | 164 |
| 164 const std::string* client_capabilities() const { | 165 const std::string* client_capabilities() const { |
| 165 return client_capabilities_.get(); | 166 return client_capabilities_.get(); |
| 166 } | 167 } |
| 167 | 168 |
| 169 // Setting enable_cast notifies ClientSession that cast-mode is | |
| 170 // supported by the host. Enabling cast mode means that if requested by | |
| 171 // the client, the ClientSession may switch from default video streaming | |
| 172 // to using WebRTC, via the CastExtension mechanism. If the ClientSession | |
| 173 // receives no request, video streaming carries on normally. This switch is | |
| 174 // currently allowed on a per-session basis, i.e., if the client requests | |
| 175 // cast mode but then wants to switch back, it must reconnect. | |
| 176 void set_enable_cast(bool enable) { enable_cast_ = enable; } | |
| 177 | |
| 178 scoped_refptr<base::SingleThreadTaskRunner> network_task_runner() { | |
| 179 return network_task_runner_; | |
| 180 } | |
| 181 | |
| 182 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner() { | |
|
Sergey Ulanov
2014/07/24 19:11:36
I'm not sure why you need these methods here. Can
aiguha
2014/07/28 17:11:56
Yes I can pass the task runners to the extension c
Sergey Ulanov
2014/07/28 17:19:06
Yes - it's the same mechanism we use in other plac
aiguha
2014/07/28 17:44:33
Done.
| |
| 183 return video_capture_task_runner_; | |
| 184 } | |
| 185 | |
| 186 // Stops the VideoScheduler (which stops capturing, encoding and streaming) | |
| 187 // and passes a new ScreenCapturer to the caller. | |
| 188 scoped_ptr<webrtc::ScreenCapturer> RequestScreenCapturer(); | |
| 189 | |
| 168 private: | 190 private: |
| 169 typedef ScopedVector<HostExtensionSession> HostExtensionSessionList; | 191 typedef ScopedVector<HostExtensionSession> HostExtensionSessionList; |
| 170 | 192 |
| 171 // Creates a proxy for sending clipboard events to the client. | 193 // Creates a proxy for sending clipboard events to the client. |
| 172 scoped_ptr<protocol::ClipboardStub> CreateClipboardProxy(); | 194 scoped_ptr<protocol::ClipboardStub> CreateClipboardProxy(); |
| 173 | 195 |
| 174 // Creates an audio encoder for the specified configuration. | 196 // Creates an audio encoder for the specified configuration. |
| 175 static scoped_ptr<AudioEncoder> CreateAudioEncoder( | 197 static scoped_ptr<AudioEncoder> CreateAudioEncoder( |
| 176 const protocol::SessionConfig& config); | 198 const protocol::SessionConfig& config); |
| 177 | 199 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 259 | 281 |
| 260 // The pairing registry for PIN-less authentication. | 282 // The pairing registry for PIN-less authentication. |
| 261 scoped_refptr<protocol::PairingRegistry> pairing_registry_; | 283 scoped_refptr<protocol::PairingRegistry> pairing_registry_; |
| 262 | 284 |
| 263 // Used to proxy gnubby auth traffic. | 285 // Used to proxy gnubby auth traffic. |
| 264 scoped_ptr<GnubbyAuthHandler> gnubby_auth_handler_; | 286 scoped_ptr<GnubbyAuthHandler> gnubby_auth_handler_; |
| 265 | 287 |
| 266 // Host extension sessions, used to handle extension messages. | 288 // Host extension sessions, used to handle extension messages. |
| 267 HostExtensionSessionList extension_sessions_; | 289 HostExtensionSessionList extension_sessions_; |
| 268 | 290 |
| 291 // True if cast mode is enabled on the host. | |
| 292 bool enable_cast_; | |
| 293 | |
| 269 DISALLOW_COPY_AND_ASSIGN(ClientSession); | 294 DISALLOW_COPY_AND_ASSIGN(ClientSession); |
| 270 }; | 295 }; |
| 271 | 296 |
| 272 } // namespace remoting | 297 } // namespace remoting |
| 273 | 298 |
| 274 #endif // REMOTING_HOST_CLIENT_SESSION_H_ | 299 #endif // REMOTING_HOST_CLIENT_SESSION_H_ |
| OLD | NEW |