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 #include "remoting/host/desktop_session_proxy.h" | 5 #include "remoting/host/desktop_session_proxy.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/platform_file.h" | 9 #include "base/platform_file.h" |
10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
11 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
12 #include "ipc/ipc_channel_proxy.h" | 12 #include "ipc/ipc_channel_proxy.h" |
13 #include "ipc/ipc_message_macros.h" | 13 #include "ipc/ipc_message_macros.h" |
14 #include "media/video/capture/screen/screen_capture_data.h" | 14 #include "media/video/capture/screen/screen_capture_data.h" |
15 #include "remoting/host/chromoting_messages.h" | 15 #include "remoting/host/chromoting_messages.h" |
16 #include "remoting/host/client_session.h" | 16 #include "remoting/host/client_session.h" |
17 #include "remoting/host/desktop_session_connector.h" | 17 #include "remoting/host/desktop_session_connector.h" |
18 #include "remoting/host/ipc_audio_capturer.h" | 18 #include "remoting/host/ipc_audio_capturer.h" |
19 #include "remoting/host/ipc_event_executor.h" | 19 #include "remoting/host/ipc_input_injector.h" |
20 #include "remoting/host/ipc_session_controller.h" | 20 #include "remoting/host/ipc_session_controller.h" |
21 #include "remoting/host/ipc_video_frame_capturer.h" | 21 #include "remoting/host/ipc_video_frame_capturer.h" |
22 #include "remoting/host/session_controller.h" | 22 #include "remoting/host/session_controller.h" |
23 #include "remoting/proto/audio.pb.h" | 23 #include "remoting/proto/audio.pb.h" |
24 #include "remoting/proto/control.pb.h" | 24 #include "remoting/proto/control.pb.h" |
25 #include "remoting/proto/event.pb.h" | 25 #include "remoting/proto/event.pb.h" |
26 | 26 |
27 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
28 #include "base/win/scoped_handle.h" | 28 #include "base/win/scoped_handle.h" |
29 #endif // defined(OS_WIN) | 29 #endif // defined(OS_WIN) |
(...skipping 18 matching lines...) Expand all Loading... |
48 | 48 |
49 scoped_ptr<AudioCapturer> DesktopSessionProxy::CreateAudioCapturer( | 49 scoped_ptr<AudioCapturer> DesktopSessionProxy::CreateAudioCapturer( |
50 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner) { | 50 scoped_refptr<base::SingleThreadTaskRunner> audio_task_runner) { |
51 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 51 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
52 DCHECK(!audio_capture_task_runner_); | 52 DCHECK(!audio_capture_task_runner_); |
53 | 53 |
54 audio_capture_task_runner_ = audio_task_runner; | 54 audio_capture_task_runner_ = audio_task_runner; |
55 return scoped_ptr<AudioCapturer>(new IpcAudioCapturer(this)); | 55 return scoped_ptr<AudioCapturer>(new IpcAudioCapturer(this)); |
56 } | 56 } |
57 | 57 |
58 scoped_ptr<EventExecutor> DesktopSessionProxy::CreateEventExecutor( | 58 scoped_ptr<InputInjector> DesktopSessionProxy::CreateInputInjector( |
59 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, | 59 scoped_refptr<base::SingleThreadTaskRunner> input_task_runner, |
60 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { | 60 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) { |
61 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 61 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
62 | 62 |
63 return scoped_ptr<EventExecutor>(new IpcEventExecutor(this)); | 63 return scoped_ptr<InputInjector>(new IpcInputInjector(this)); |
64 } | 64 } |
65 | 65 |
66 scoped_ptr<SessionController> DesktopSessionProxy::CreateSessionController() { | 66 scoped_ptr<SessionController> DesktopSessionProxy::CreateSessionController() { |
67 return scoped_ptr<SessionController>(new IpcSessionController(this)); | 67 return scoped_ptr<SessionController>(new IpcSessionController(this)); |
68 } | 68 } |
69 | 69 |
70 scoped_ptr<media::ScreenCapturer> DesktopSessionProxy::CreateVideoCapturer( | 70 scoped_ptr<media::ScreenCapturer> DesktopSessionProxy::CreateVideoCapturer( |
71 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, | 71 scoped_refptr<base::SingleThreadTaskRunner> capture_task_runner, |
72 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) { | 72 scoped_refptr<base::SingleThreadTaskRunner> encode_task_runner) { |
73 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 73 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 std::string serialized_event; | 267 std::string serialized_event; |
268 if (!event.SerializeToString(&serialized_event)) { | 268 if (!event.SerializeToString(&serialized_event)) { |
269 LOG(ERROR) << "Failed to serialize protocol::MouseEvent."; | 269 LOG(ERROR) << "Failed to serialize protocol::MouseEvent."; |
270 return; | 270 return; |
271 } | 271 } |
272 | 272 |
273 SendToDesktop( | 273 SendToDesktop( |
274 new ChromotingNetworkDesktopMsg_InjectMouseEvent(serialized_event)); | 274 new ChromotingNetworkDesktopMsg_InjectMouseEvent(serialized_event)); |
275 } | 275 } |
276 | 276 |
277 void DesktopSessionProxy::StartEventExecutor( | 277 void DesktopSessionProxy::StartInputInjector( |
278 scoped_ptr<protocol::ClipboardStub> client_clipboard) { | 278 scoped_ptr<protocol::ClipboardStub> client_clipboard) { |
279 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 279 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
280 | 280 |
281 client_clipboard_ = client_clipboard.Pass(); | 281 client_clipboard_ = client_clipboard.Pass(); |
282 } | 282 } |
283 | 283 |
284 void DesktopSessionProxy::SetScreenResolution( | 284 void DesktopSessionProxy::SetScreenResolution( |
285 const ScreenResolution& resolution) { | 285 const ScreenResolution& resolution) { |
286 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 286 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
287 | 287 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 } | 484 } |
485 | 485 |
486 // static | 486 // static |
487 void DesktopSessionProxyTraits::Destruct( | 487 void DesktopSessionProxyTraits::Destruct( |
488 const DesktopSessionProxy* desktop_session_proxy) { | 488 const DesktopSessionProxy* desktop_session_proxy) { |
489 desktop_session_proxy->caller_task_runner_->DeleteSoon(FROM_HERE, | 489 desktop_session_proxy->caller_task_runner_->DeleteSoon(FROM_HERE, |
490 desktop_session_proxy); | 490 desktop_session_proxy); |
491 } | 491 } |
492 | 492 |
493 } // namespace remoting | 493 } // namespace remoting |
OLD | NEW |