| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 shared_buffers_.erase(id); | 477 shared_buffers_.erase(id); |
| 478 } | 478 } |
| 479 | 479 |
| 480 void DesktopSessionProxy::OnCaptureResult( | 480 void DesktopSessionProxy::OnCaptureResult( |
| 481 webrtc::DesktopCapturer::Result result, | 481 webrtc::DesktopCapturer::Result result, |
| 482 const SerializedDesktopFrame& serialized_frame) { | 482 const SerializedDesktopFrame& serialized_frame) { |
| 483 DCHECK(caller_task_runner_->BelongsToCurrentThread()); | 483 DCHECK(caller_task_runner_->BelongsToCurrentThread()); |
| 484 | 484 |
| 485 --pending_capture_frame_requests_; | 485 --pending_capture_frame_requests_; |
| 486 | 486 |
| 487 if (!video_capturer_) { |
| 488 return; |
| 489 } |
| 490 |
| 487 if (result != webrtc::DesktopCapturer::Result::SUCCESS) { | 491 if (result != webrtc::DesktopCapturer::Result::SUCCESS) { |
| 488 video_capturer_->OnCaptureResult(result, nullptr); | 492 video_capturer_->OnCaptureResult(result, nullptr); |
| 489 return; | 493 return; |
| 490 } | 494 } |
| 491 | 495 |
| 492 // Assume that |serialized_frame| is well-formed because it was received from | 496 // Assume that |serialized_frame| is well-formed because it was received from |
| 493 // a more privileged process. | 497 // a more privileged process. |
| 494 scoped_refptr<IpcSharedBufferCore> shared_buffer_core = | 498 scoped_refptr<IpcSharedBufferCore> shared_buffer_core = |
| 495 GetSharedBufferCore(serialized_frame.shared_buffer_id); | 499 GetSharedBufferCore(serialized_frame.shared_buffer_id); |
| 496 CHECK(shared_buffer_core.get()); | 500 CHECK(shared_buffer_core.get()); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 } | 550 } |
| 547 | 551 |
| 548 // static | 552 // static |
| 549 void DesktopSessionProxyTraits::Destruct( | 553 void DesktopSessionProxyTraits::Destruct( |
| 550 const DesktopSessionProxy* desktop_session_proxy) { | 554 const DesktopSessionProxy* desktop_session_proxy) { |
| 551 desktop_session_proxy->caller_task_runner_->DeleteSoon(FROM_HERE, | 555 desktop_session_proxy->caller_task_runner_->DeleteSoon(FROM_HERE, |
| 552 desktop_session_proxy); | 556 desktop_session_proxy); |
| 553 } | 557 } |
| 554 | 558 |
| 555 } // namespace remoting | 559 } // namespace remoting |
| OLD | NEW |