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_agent.h" | 5 #include "remoting/host/desktop_session_agent.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
10 #include "ipc/ipc_channel_proxy.h" | 10 #include "ipc/ipc_channel_proxy.h" |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 void DesktopSessionAgent::OnCaptureFrame() { | 434 void DesktopSessionAgent::OnCaptureFrame() { |
435 if (!video_capture_task_runner_->BelongsToCurrentThread()) { | 435 if (!video_capture_task_runner_->BelongsToCurrentThread()) { |
436 video_capture_task_runner_->PostTask( | 436 video_capture_task_runner_->PostTask( |
437 FROM_HERE, | 437 FROM_HERE, |
438 base::Bind(&DesktopSessionAgent::OnCaptureFrame, this)); | 438 base::Bind(&DesktopSessionAgent::OnCaptureFrame, this)); |
439 return; | 439 return; |
440 } | 440 } |
441 | 441 |
442 mouse_cursor_monitor_->Capture(); | 442 mouse_cursor_monitor_->Capture(); |
443 | 443 |
444 // webrtc::ScreenCapturer supports a very few (currently 2) outstanding | 444 // webrtc::DesktopCapturer supports a very few (currently 2) outstanding |
445 // capture requests. The requests are serialized on | 445 // capture requests. The requests are serialized on |
446 // |video_capture_task_runner()| task runner. If the client issues more | 446 // |video_capture_task_runner()| task runner. If the client issues more |
447 // requests, pixel data in captured frames will likely be corrupted but | 447 // requests, pixel data in captured frames will likely be corrupted but |
448 // stability of webrtc::ScreenCapturer will not be affected. | 448 // stability of webrtc::DesktopCapturer will not be affected. |
449 video_capturer_->Capture(webrtc::DesktopRegion()); | 449 video_capturer_->Capture(webrtc::DesktopRegion()); |
450 } | 450 } |
451 | 451 |
452 void DesktopSessionAgent::OnInjectClipboardEvent( | 452 void DesktopSessionAgent::OnInjectClipboardEvent( |
453 const std::string& serialized_event) { | 453 const std::string& serialized_event) { |
454 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 454 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
455 | 455 |
456 protocol::ClipboardEvent event; | 456 protocol::ClipboardEvent event; |
457 if (!event.ParseFromString(serialized_event)) { | 457 if (!event.ParseFromString(serialized_event)) { |
458 LOG(ERROR) << "Failed to parse protocol::ClipboardEvent."; | 458 LOG(ERROR) << "Failed to parse protocol::ClipboardEvent."; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 void DesktopSessionAgent::OnSharedBufferDeleted(int id) { | 583 void DesktopSessionAgent::OnSharedBufferDeleted(int id) { |
584 DCHECK(video_capture_task_runner_->BelongsToCurrentThread()); | 584 DCHECK(video_capture_task_runner_->BelongsToCurrentThread()); |
585 DCHECK(id != 0); | 585 DCHECK(id != 0); |
586 | 586 |
587 shared_buffers_--; | 587 shared_buffers_--; |
588 DCHECK_GE(shared_buffers_, 0); | 588 DCHECK_GE(shared_buffers_, 0); |
589 SendToNetwork(new ChromotingDesktopNetworkMsg_ReleaseSharedBuffer(id)); | 589 SendToNetwork(new ChromotingDesktopNetworkMsg_ReleaseSharedBuffer(id)); |
590 } | 590 } |
591 | 591 |
592 } // namespace remoting | 592 } // namespace remoting |
OLD | NEW |