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 #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_event_executor.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/screen_resolution.h" | |
| 22 #include "remoting/host/session_controller.h" | 23 #include "remoting/host/session_controller.h" |
| 23 #include "remoting/proto/audio.pb.h" | 24 #include "remoting/proto/audio.pb.h" |
| 24 #include "remoting/proto/control.pb.h" | 25 #include "remoting/proto/control.pb.h" |
| 25 #include "remoting/proto/event.pb.h" | 26 #include "remoting/proto/event.pb.h" |
| 26 | 27 |
| 27 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
| 28 #include "base/win/scoped_handle.h" | 29 #include "base/win/scoped_handle.h" |
| 29 #endif // defined(OS_WIN) | 30 #endif // defined(OS_WIN) |
| 30 | 31 |
| 31 namespace remoting { | 32 namespace remoting { |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 272 new ChromotingNetworkDesktopMsg_InjectMouseEvent(serialized_event)); | 273 new ChromotingNetworkDesktopMsg_InjectMouseEvent(serialized_event)); |
| 273 } | 274 } |
| 274 | 275 |
| 275 void DesktopSessionProxy::StartEventExecutor( | 276 void DesktopSessionProxy::StartEventExecutor( |
| 276 scoped_ptr<protocol::ClipboardStub> client_clipboard) { | 277 scoped_ptr<protocol::ClipboardStub> client_clipboard) { |
| 277 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 278 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
| 278 | 279 |
| 279 client_clipboard_ = client_clipboard.Pass(); | 280 client_clipboard_ = client_clipboard.Pass(); |
| 280 } | 281 } |
| 281 | 282 |
| 283 void DesktopSessionProxy::SetScreenResolution( | |
|
Jamie
2013/03/15 18:33:24
For a CL that's primarily a global rename, I was s
alexeypa (please no reviews)
2013/03/15 20:30:41
This leaked from the follow up CL. I moved this co
| |
| 284 const ScreenResolution& resolution) { | |
| 285 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | |
| 286 | |
| 287 // Pass the client's resolution to the daemon. | |
| 288 if (desktop_session_connector_) | |
| 289 desktop_session_connector_->SetScreenResolution(this, resolution); | |
| 290 | |
| 291 // Pass the client's resolution to the DesktopSessionAgent instance. | |
| 292 SendToDesktop( | |
| 293 new ChromotingNetworkDesktopMsg_SetScreenResolution(resolution)); | |
| 294 } | |
| 295 | |
| 282 void DesktopSessionProxy::ConnectToDesktopSession( | 296 void DesktopSessionProxy::ConnectToDesktopSession( |
| 283 base::WeakPtr<DesktopSessionConnector> desktop_session_connector, | 297 base::WeakPtr<DesktopSessionConnector> desktop_session_connector, |
| 284 bool virtual_terminal) { | 298 bool virtual_terminal) { |
| 285 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 299 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
| 286 DCHECK(!desktop_session_connector_); | 300 DCHECK(!desktop_session_connector_); |
| 287 DCHECK(desktop_session_connector); | 301 DCHECK(desktop_session_connector); |
| 288 | 302 |
| 289 desktop_session_connector_ = desktop_session_connector; | 303 desktop_session_connector_ = desktop_session_connector; |
| 290 desktop_session_connector_->ConnectTerminal( | 304 desktop_session_connector_->ConnectTerminal( |
| 291 this, DesktopSessionParams(), virtual_terminal); | 305 this, ScreenResolution(), virtual_terminal); |
| 292 } | 306 } |
| 293 | 307 |
| 294 DesktopSessionProxy::~DesktopSessionProxy() { | 308 DesktopSessionProxy::~DesktopSessionProxy() { |
| 295 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 309 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
| 296 | 310 |
| 297 if (desktop_session_connector_) | 311 if (desktop_session_connector_) |
| 298 desktop_session_connector_->DisconnectTerminal(this); | 312 desktop_session_connector_->DisconnectTerminal(this); |
| 299 | 313 |
| 300 if (desktop_process_ != base::kNullProcessHandle) { | 314 if (desktop_process_ != base::kNullProcessHandle) { |
| 301 base::CloseProcessHandle(desktop_process_); | 315 base::CloseProcessHandle(desktop_process_); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 464 } | 478 } |
| 465 | 479 |
| 466 // static | 480 // static |
| 467 void DesktopSessionProxyTraits::Destruct( | 481 void DesktopSessionProxyTraits::Destruct( |
| 468 const DesktopSessionProxy* desktop_session_proxy) { | 482 const DesktopSessionProxy* desktop_session_proxy) { |
| 469 desktop_session_proxy->caller_task_runner_->DeleteSoon(FROM_HERE, | 483 desktop_session_proxy->caller_task_runner_->DeleteSoon(FROM_HERE, |
| 470 desktop_session_proxy); | 484 desktop_session_proxy); |
| 471 } | 485 } |
| 472 | 486 |
| 473 } // namespace remoting | 487 } // namespace remoting |
| OLD | NEW |