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_AGENT_H_ | 5 #ifndef REMOTING_HOST_DESKTOP_SESSION_AGENT_H_ |
6 #define REMOTING_HOST_DESKTOP_SESSION_AGENT_H_ | 6 #define REMOTING_HOST_DESKTOP_SESSION_AGENT_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 // Notifies the delegate that the network-to-desktop channel has been | 64 // Notifies the delegate that the network-to-desktop channel has been |
65 // disconnected. | 65 // disconnected. |
66 virtual void OnNetworkProcessDisconnected() = 0; | 66 virtual void OnNetworkProcessDisconnected() = 0; |
67 }; | 67 }; |
68 | 68 |
69 DesktopSessionAgent( | 69 DesktopSessionAgent( |
70 scoped_refptr<AutoThreadTaskRunner> audio_capture_task_runner, | 70 scoped_refptr<AutoThreadTaskRunner> audio_capture_task_runner, |
71 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, | 71 scoped_refptr<AutoThreadTaskRunner> caller_task_runner, |
72 scoped_refptr<AutoThreadTaskRunner> input_task_runner, | 72 scoped_refptr<AutoThreadTaskRunner> input_task_runner, |
73 scoped_refptr<AutoThreadTaskRunner> io_task_runner, | 73 scoped_refptr<AutoThreadTaskRunner> io_task_runner); |
74 scoped_refptr<AutoThreadTaskRunner> video_capture_task_runner); | |
75 | 74 |
76 // IPC::Listener implementation. | 75 // IPC::Listener implementation. |
77 bool OnMessageReceived(const IPC::Message& message) override; | 76 bool OnMessageReceived(const IPC::Message& message) override; |
78 void OnChannelConnected(int32_t peer_pid) override; | 77 void OnChannelConnected(int32_t peer_pid) override; |
79 void OnChannelError() override; | 78 void OnChannelError() override; |
80 | 79 |
81 // webrtc::DesktopCapturer::Callback implementation. | 80 // webrtc::DesktopCapturer::Callback implementation. |
82 void OnCaptureCompleted(webrtc::DesktopFrame* frame) override; | 81 void OnCaptureCompleted(webrtc::DesktopFrame* frame) override; |
83 | 82 |
84 // webrtc::MouseCursorMonitor::Callback implementation. | 83 // webrtc::MouseCursorMonitor::Callback implementation. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 134 |
136 // Sends a message to the network process. | 135 // Sends a message to the network process. |
137 void SendToNetwork(scoped_ptr<IPC::Message> message); | 136 void SendToNetwork(scoped_ptr<IPC::Message> message); |
138 | 137 |
139 // Posted to |audio_capture_task_runner_| to start the audio capturer. | 138 // Posted to |audio_capture_task_runner_| to start the audio capturer. |
140 void StartAudioCapturer(); | 139 void StartAudioCapturer(); |
141 | 140 |
142 // Posted to |audio_capture_task_runner_| to stop the audio capturer. | 141 // Posted to |audio_capture_task_runner_| to stop the audio capturer. |
143 void StopAudioCapturer(); | 142 void StopAudioCapturer(); |
144 | 143 |
145 // Posted to |video_capture_task_runner_| to start the video capturer and the | |
146 // mouse cursor monitor. | |
147 void StartVideoCapturerAndMouseMonitor(); | |
148 | |
149 // Posted to |video_capture_task_runner_| to stop the video capturer and the | |
150 // mouse cursor monitor. | |
151 void StopVideoCapturerAndMouseMonitor(); | |
152 | |
153 private: | 144 private: |
154 // Task runner dedicated to running methods of |audio_capturer_|. | 145 // Task runner dedicated to running methods of |audio_capturer_|. |
155 scoped_refptr<AutoThreadTaskRunner> audio_capture_task_runner_; | 146 scoped_refptr<AutoThreadTaskRunner> audio_capture_task_runner_; |
156 | 147 |
157 // Task runner on which public methods of this class should be called. | 148 // Task runner on which public methods of this class should be called. |
158 scoped_refptr<AutoThreadTaskRunner> caller_task_runner_; | 149 scoped_refptr<AutoThreadTaskRunner> caller_task_runner_; |
159 | 150 |
160 // Task runner on which keyboard/mouse input is injected. | 151 // Task runner on which keyboard/mouse input is injected. |
161 scoped_refptr<AutoThreadTaskRunner> input_task_runner_; | 152 scoped_refptr<AutoThreadTaskRunner> input_task_runner_; |
162 | 153 |
163 // Task runner used by the IPC channel. | 154 // Task runner used by the IPC channel. |
164 scoped_refptr<AutoThreadTaskRunner> io_task_runner_; | 155 scoped_refptr<AutoThreadTaskRunner> io_task_runner_; |
165 | 156 |
166 // Task runner dedicated to running methods of |video_capturer_|. | |
167 scoped_refptr<AutoThreadTaskRunner> video_capture_task_runner_; | |
168 | |
169 // Captures audio output. | 157 // Captures audio output. |
170 scoped_ptr<AudioCapturer> audio_capturer_; | 158 scoped_ptr<AudioCapturer> audio_capturer_; |
171 | 159 |
172 std::string client_jid_; | 160 std::string client_jid_; |
173 | 161 |
174 base::WeakPtr<Delegate> delegate_; | 162 base::WeakPtr<Delegate> delegate_; |
175 | 163 |
176 // The DesktopEnvironment instance used by this agent. | 164 // The DesktopEnvironment instance used by this agent. |
177 scoped_ptr<DesktopEnvironment> desktop_environment_; | 165 scoped_ptr<DesktopEnvironment> desktop_environment_; |
178 | 166 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 | 201 |
214 // Used to disable callbacks to |this|. | 202 // Used to disable callbacks to |this|. |
215 base::WeakPtrFactory<DesktopSessionAgent> weak_factory_; | 203 base::WeakPtrFactory<DesktopSessionAgent> weak_factory_; |
216 | 204 |
217 DISALLOW_COPY_AND_ASSIGN(DesktopSessionAgent); | 205 DISALLOW_COPY_AND_ASSIGN(DesktopSessionAgent); |
218 }; | 206 }; |
219 | 207 |
220 } // namespace remoting | 208 } // namespace remoting |
221 | 209 |
222 #endif // REMOTING_HOST_DESKTOP_SESSION_AGENT_H_ | 210 #endif // REMOTING_HOST_DESKTOP_SESSION_AGENT_H_ |
OLD | NEW |