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_DESKTOP_SESSION_PROXY_H_ | 5 #ifndef REMOTING_HOST_DESKTOP_SESSION_PROXY_H_ |
6 #define REMOTING_HOST_DESKTOP_SESSION_PROXY_H_ | 6 #define REMOTING_HOST_DESKTOP_SESSION_PROXY_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // the |caller_task_runner_| thread unless it is specified otherwise. | 69 // the |caller_task_runner_| thread unless it is specified otherwise. |
70 class DesktopSessionProxy | 70 class DesktopSessionProxy |
71 : public base::RefCountedThreadSafe<DesktopSessionProxy, | 71 : public base::RefCountedThreadSafe<DesktopSessionProxy, |
72 DesktopSessionProxyTraits>, | 72 DesktopSessionProxyTraits>, |
73 public IPC::Listener { | 73 public IPC::Listener { |
74 public: | 74 public: |
75 DesktopSessionProxy( | 75 DesktopSessionProxy( |
76 scoped_refptr<base::SingleThreadTaskRunner> audio_capture_task_runner, | 76 scoped_refptr<base::SingleThreadTaskRunner> audio_capture_task_runner, |
77 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 77 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
78 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, | 78 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
79 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner, | |
80 base::WeakPtr<ClientSessionControl> client_session_control, | 79 base::WeakPtr<ClientSessionControl> client_session_control, |
81 base::WeakPtr<DesktopSessionConnector> desktop_session_connector, | 80 base::WeakPtr<DesktopSessionConnector> desktop_session_connector, |
82 bool virtual_terminal, | 81 bool virtual_terminal, |
83 bool supports_touch_events); | 82 bool supports_touch_events); |
84 | 83 |
85 // Mirrors DesktopEnvironment. | 84 // Mirrors DesktopEnvironment. |
86 scoped_ptr<AudioCapturer> CreateAudioCapturer(); | 85 scoped_ptr<AudioCapturer> CreateAudioCapturer(); |
87 scoped_ptr<InputInjector> CreateInputInjector(); | 86 scoped_ptr<InputInjector> CreateInputInjector(); |
88 scoped_ptr<ScreenControls> CreateScreenControls(); | 87 scoped_ptr<ScreenControls> CreateScreenControls(); |
89 scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer(); | 88 scoped_ptr<webrtc::DesktopCapturer> CreateVideoCapturer(); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 161 |
163 // Handles CaptureCompleted notification from the desktop session agent. | 162 // Handles CaptureCompleted notification from the desktop session agent. |
164 void OnCaptureCompleted(const SerializedDesktopFrame& serialized_frame); | 163 void OnCaptureCompleted(const SerializedDesktopFrame& serialized_frame); |
165 | 164 |
166 // Handles MouseCursor notification from the desktop session agent. | 165 // Handles MouseCursor notification from the desktop session agent. |
167 void OnMouseCursor(const webrtc::MouseCursor& mouse_cursor); | 166 void OnMouseCursor(const webrtc::MouseCursor& mouse_cursor); |
168 | 167 |
169 // Handles InjectClipboardEvent request from the desktop integration process. | 168 // Handles InjectClipboardEvent request from the desktop integration process. |
170 void OnInjectClipboardEvent(const std::string& serialized_event); | 169 void OnInjectClipboardEvent(const std::string& serialized_event); |
171 | 170 |
172 // Posts OnCaptureCompleted() to |video_capturer_| on the video thread, | |
173 // passing |frame|. | |
174 void PostCaptureCompleted(scoped_ptr<webrtc::DesktopFrame> frame); | |
175 | |
176 // Posts OnMouseCursor() to |mouse_cursor_monitor_| on the video thread, | |
177 // passing |mouse_cursor|. | |
178 void PostMouseCursor(scoped_ptr<webrtc::MouseCursor> mouse_cursor); | |
179 | |
180 // Sends a message to the desktop session agent. The message is silently | 171 // Sends a message to the desktop session agent. The message is silently |
181 // deleted if the channel is broken. | 172 // deleted if the channel is broken. |
182 void SendToDesktop(IPC::Message* message); | 173 void SendToDesktop(IPC::Message* message); |
183 | 174 |
184 // Task runners: | 175 // Task runners: |
185 // - |audio_capturer_| is called back on |audio_capture_task_runner_|. | 176 // - |audio_capturer_| is called back on |audio_capture_task_runner_|. |
186 // - public methods of this class (with some exceptions) are called on | 177 // - public methods of this class (with some exceptions) are called on |
187 // |caller_task_runner_|. | 178 // |caller_task_runner_|. |
188 // - background I/O is served on |io_task_runner_|. | 179 // - background I/O is served on |io_task_runner_|. |
189 // - |video_capturer_| is called back on |video_capture_task_runner_|. | |
190 scoped_refptr<base::SingleThreadTaskRunner> audio_capture_task_runner_; | 180 scoped_refptr<base::SingleThreadTaskRunner> audio_capture_task_runner_; |
191 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; | 181 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; |
192 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 182 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
193 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner_; | |
194 | 183 |
195 // Points to the audio capturer receiving captured audio packets. | 184 // Points to the audio capturer receiving captured audio packets. |
196 base::WeakPtr<IpcAudioCapturer> audio_capturer_; | 185 base::WeakPtr<IpcAudioCapturer> audio_capturer_; |
197 | 186 |
198 // Points to the client stub passed to StartInputInjector(). | 187 // Points to the client stub passed to StartInputInjector(). |
199 scoped_ptr<protocol::ClipboardStub> client_clipboard_; | 188 scoped_ptr<protocol::ClipboardStub> client_clipboard_; |
200 | 189 |
201 // Used to disconnect the client session. | 190 // Used to disconnect the client session. |
202 base::WeakPtr<ClientSessionControl> client_session_control_; | 191 base::WeakPtr<ClientSessionControl> client_session_control_; |
203 | 192 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 }; | 228 }; |
240 | 229 |
241 // Destroys |DesktopSessionProxy| instances on the caller's thread. | 230 // Destroys |DesktopSessionProxy| instances on the caller's thread. |
242 struct DesktopSessionProxyTraits { | 231 struct DesktopSessionProxyTraits { |
243 static void Destruct(const DesktopSessionProxy* desktop_session_proxy); | 232 static void Destruct(const DesktopSessionProxy* desktop_session_proxy); |
244 }; | 233 }; |
245 | 234 |
246 } // namespace remoting | 235 } // namespace remoting |
247 | 236 |
248 #endif // REMOTING_HOST_DESKTOP_SESSION_PROXY_H_ | 237 #endif // REMOTING_HOST_DESKTOP_SESSION_PROXY_H_ |
OLD | NEW |