Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "media/capture/content/screen_capture_device_core.h" | 5 #include "media/capture/content/screen_capture_device_core.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 oracle_proxy_ = new ThreadSafeCaptureOracle( | 58 oracle_proxy_ = new ThreadSafeCaptureOracle( |
| 59 std::move(client), params, capture_machine_->IsAutoThrottlingEnabled()); | 59 std::move(client), params, capture_machine_->IsAutoThrottlingEnabled()); |
| 60 | 60 |
| 61 capture_machine_->Start( | 61 capture_machine_->Start( |
| 62 oracle_proxy_, params, | 62 oracle_proxy_, params, |
| 63 base::Bind(&ScreenCaptureDeviceCore::CaptureStarted, AsWeakPtr())); | 63 base::Bind(&ScreenCaptureDeviceCore::CaptureStarted, AsWeakPtr())); |
| 64 | 64 |
| 65 TransitionStateTo(kCapturing); | 65 TransitionStateTo(kCapturing); |
| 66 } | 66 } |
| 67 | 67 |
| 68 void ScreenCaptureDeviceCore::RequestRefreshFrame() { | |
|
Irfan
2016/04/06 19:53:05
Any value in providing feedback when the request i
miu
2016/04/06 22:33:53
No. The request originates in the renderer proces
| |
| 69 DCHECK(thread_checker_.CalledOnValidThread()); | |
| 70 | |
| 71 if (state_ != kCapturing) | |
| 72 return; | |
| 73 | |
| 74 if (oracle_proxy_->AttemptPassiveRefresh()) | |
| 75 return; | |
| 76 capture_machine_->MaybeCaptureForRefresh(); | |
| 77 } | |
| 78 | |
| 68 void ScreenCaptureDeviceCore::StopAndDeAllocate() { | 79 void ScreenCaptureDeviceCore::StopAndDeAllocate() { |
| 69 DCHECK(thread_checker_.CalledOnValidThread()); | 80 DCHECK(thread_checker_.CalledOnValidThread()); |
| 70 | 81 |
| 71 if (state_ != kCapturing) | 82 if (state_ != kCapturing) |
| 72 return; | 83 return; |
| 73 | 84 |
| 74 oracle_proxy_->Stop(); | 85 oracle_proxy_->Stop(); |
| 75 oracle_proxy_ = NULL; | 86 oracle_proxy_ = NULL; |
| 76 | 87 |
| 77 TransitionStateTo(kIdle); | 88 TransitionStateTo(kIdle); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 123 return; | 134 return; |
| 124 | 135 |
| 125 if (oracle_proxy_.get()) | 136 if (oracle_proxy_.get()) |
| 126 oracle_proxy_->ReportError(from_here, reason); | 137 oracle_proxy_->ReportError(from_here, reason); |
| 127 | 138 |
| 128 StopAndDeAllocate(); | 139 StopAndDeAllocate(); |
| 129 TransitionStateTo(kError); | 140 TransitionStateTo(kError); |
| 130 } | 141 } |
| 131 | 142 |
| 132 } // namespace media | 143 } // namespace media |
| OLD | NEW |