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 <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 // video_capturer_ has been released before DesktopSessionAgent returns this | |
|
Sergey Ulanov
2016/08/12 04:15:18
nit:
1. the capturer was deleted, not released.
| |
| 489 // frame. | |
| 490 return; | |
| 491 } | |
| 492 | |
| 487 if (result != webrtc::DesktopCapturer::Result::SUCCESS) { | 493 if (result != webrtc::DesktopCapturer::Result::SUCCESS) { |
| 488 video_capturer_->OnCaptureResult(result, nullptr); | 494 video_capturer_->OnCaptureResult(result, nullptr); |
| 489 return; | 495 return; |
| 490 } | 496 } |
| 491 | 497 |
| 492 // Assume that |serialized_frame| is well-formed because it was received from | 498 // Assume that |serialized_frame| is well-formed because it was received from |
| 493 // a more privileged process. | 499 // a more privileged process. |
| 494 scoped_refptr<IpcSharedBufferCore> shared_buffer_core = | 500 scoped_refptr<IpcSharedBufferCore> shared_buffer_core = |
| 495 GetSharedBufferCore(serialized_frame.shared_buffer_id); | 501 GetSharedBufferCore(serialized_frame.shared_buffer_id); |
| 496 CHECK(shared_buffer_core.get()); | 502 CHECK(shared_buffer_core.get()); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 546 } | 552 } |
| 547 | 553 |
| 548 // static | 554 // static |
| 549 void DesktopSessionProxyTraits::Destruct( | 555 void DesktopSessionProxyTraits::Destruct( |
| 550 const DesktopSessionProxy* desktop_session_proxy) { | 556 const DesktopSessionProxy* desktop_session_proxy) { |
| 551 desktop_session_proxy->caller_task_runner_->DeleteSoon(FROM_HERE, | 557 desktop_session_proxy->caller_task_runner_->DeleteSoon(FROM_HERE, |
| 552 desktop_session_proxy); | 558 desktop_session_proxy); |
| 553 } | 559 } |
| 554 | 560 |
| 555 } // namespace remoting | 561 } // namespace remoting |
| OLD | NEW |