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 <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 public: | 66 public: |
67 DesktopSessionProxy( | 67 DesktopSessionProxy( |
68 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, | 68 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner, |
69 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, | 69 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
70 const std::string& client_jid, | 70 const std::string& client_jid, |
71 const base::Closure& disconnect_callback); | 71 const base::Closure& disconnect_callback); |
72 | 72 |
73 // Mirrors DesktopEnvironment. | 73 // Mirrors DesktopEnvironment. |
74 scoped_ptr<AudioCapturer> CreateAudioCapturer( | 74 scoped_ptr<AudioCapturer> CreateAudioCapturer( |
75 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner); | 75 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner); |
76 scoped_ptr<EventExecutor> CreateEventExecutor( | 76 scoped_ptr<InputInjector> CreateInputInjector( |
77 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 77 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
78 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); | 78 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); |
79 scoped_ptr<SessionController> CreateSessionController(); | 79 scoped_ptr<SessionController> CreateSessionController(); |
80 scoped_ptr<media::ScreenCapturer> CreateVideoCapturer( | 80 scoped_ptr<media::ScreenCapturer> CreateVideoCapturer( |
81 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, | 81 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, |
82 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner); | 82 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner); |
83 | 83 |
84 // IPC::Listener implementation. | 84 // IPC::Listener implementation. |
85 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 85 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
86 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 86 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
(...skipping 22 matching lines...) Expand all Loading... |
109 // APIs used to implement the media::ScreenCapturer interface. These must be | 109 // APIs used to implement the media::ScreenCapturer interface. These must be |
110 // called on the |video_capture_task_runner_| thread. | 110 // called on the |video_capture_task_runner_| thread. |
111 void InvalidateRegion(const SkRegion& invalid_region); | 111 void InvalidateRegion(const SkRegion& invalid_region); |
112 void CaptureFrame(); | 112 void CaptureFrame(); |
113 | 113 |
114 // Stores |video_capturer| to be used to post captured video frames. Called on | 114 // Stores |video_capturer| to be used to post captured video frames. Called on |
115 // the |video_capture_task_runner_| thread. | 115 // the |video_capture_task_runner_| thread. |
116 void SetVideoCapturer( | 116 void SetVideoCapturer( |
117 const base::WeakPtr<IpcVideoFrameCapturer> video_capturer); | 117 const base::WeakPtr<IpcVideoFrameCapturer> video_capturer); |
118 | 118 |
119 // APIs used to implement the EventExecutor interface. | 119 // APIs used to implement the InputInjector interface. |
120 void InjectClipboardEvent(const protocol::ClipboardEvent& event); | 120 void InjectClipboardEvent(const protocol::ClipboardEvent& event); |
121 void InjectKeyEvent(const protocol::KeyEvent& event); | 121 void InjectKeyEvent(const protocol::KeyEvent& event); |
122 void InjectMouseEvent(const protocol::MouseEvent& event); | 122 void InjectMouseEvent(const protocol::MouseEvent& event); |
123 void StartEventExecutor(scoped_ptr<protocol::ClipboardStub> client_clipboard); | 123 void StartInputInjector(scoped_ptr<protocol::ClipboardStub> client_clipboard); |
124 | 124 |
125 // API used to implement the SessionController interface. | 125 // API used to implement the SessionController interface. |
126 void SetScreenResolution(const ScreenResolution& resolution); | 126 void SetScreenResolution(const ScreenResolution& resolution); |
127 | 127 |
128 private: | 128 private: |
129 friend class base::DeleteHelper<DesktopSessionProxy>; | 129 friend class base::DeleteHelper<DesktopSessionProxy>; |
130 friend struct DesktopSessionProxyTraits; | 130 friend struct DesktopSessionProxyTraits; |
131 virtual ~DesktopSessionProxy(); | 131 virtual ~DesktopSessionProxy(); |
132 | 132 |
133 // Returns a shared buffer from the list of known buffers. | 133 // Returns a shared buffer from the list of known buffers. |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 // - background I/O is served on |io_task_runner_|. | 173 // - background I/O is served on |io_task_runner_|. |
174 // - |video_capturer_| is called back on |video_capture_task_runner_|. | 174 // - |video_capturer_| is called back on |video_capture_task_runner_|. |
175 scoped_refptr<base::SingleThreadTaskRunner> audio_capture_task_runner_; | 175 scoped_refptr<base::SingleThreadTaskRunner> audio_capture_task_runner_; |
176 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; | 176 scoped_refptr<base::SingleThreadTaskRunner> caller_task_runner_; |
177 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 177 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
178 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner_; | 178 scoped_refptr<base::SingleThreadTaskRunner> video_capture_task_runner_; |
179 | 179 |
180 // Points to the audio capturer receiving captured audio packets. | 180 // Points to the audio capturer receiving captured audio packets. |
181 base::WeakPtr<IpcAudioCapturer> audio_capturer_; | 181 base::WeakPtr<IpcAudioCapturer> audio_capturer_; |
182 | 182 |
183 // Points to the client stub passed to StartEventExecutor(). | 183 // Points to the client stub passed to StartInputInjector(). |
184 scoped_ptr<protocol::ClipboardStub> client_clipboard_; | 184 scoped_ptr<protocol::ClipboardStub> client_clipboard_; |
185 | 185 |
186 // Used to bind to a desktop session and receive notifications every time | 186 // Used to bind to a desktop session and receive notifications every time |
187 // the desktop process is replaced. | 187 // the desktop process is replaced. |
188 base::WeakPtr<DesktopSessionConnector> desktop_session_connector_; | 188 base::WeakPtr<DesktopSessionConnector> desktop_session_connector_; |
189 | 189 |
190 // Disconnects the client session when invoked. | 190 // Disconnects the client session when invoked. |
191 base::Closure disconnect_callback_; | 191 base::Closure disconnect_callback_; |
192 | 192 |
193 // Points to the video capturer receiving captured video frames. | 193 // Points to the video capturer receiving captured video frames. |
(...skipping 21 matching lines...) Expand all Loading... |
215 }; | 215 }; |
216 | 216 |
217 // Destroys |DesktopSessionProxy| instances on the caller's thread. | 217 // Destroys |DesktopSessionProxy| instances on the caller's thread. |
218 struct DesktopSessionProxyTraits { | 218 struct DesktopSessionProxyTraits { |
219 static void Destruct(const DesktopSessionProxy* desktop_session_proxy); | 219 static void Destruct(const DesktopSessionProxy* desktop_session_proxy); |
220 }; | 220 }; |
221 | 221 |
222 } // namespace remoting | 222 } // namespace remoting |
223 | 223 |
224 #endif // REMOTING_HOST_DESKTOP_SESSION_PROXY_H_ | 224 #endif // REMOTING_HOST_DESKTOP_SESSION_PROXY_H_ |
OLD | NEW |