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 <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 return; | 106 return; |
107 | 107 |
108 oracle_proxy_->Stop(); | 108 oracle_proxy_->Stop(); |
109 oracle_proxy_ = NULL; | 109 oracle_proxy_ = NULL; |
110 | 110 |
111 TransitionStateTo(kIdle); | 111 TransitionStateTo(kIdle); |
112 | 112 |
113 capture_machine_->Stop(base::Bind(&base::DoNothing)); | 113 capture_machine_->Stop(base::Bind(&base::DoNothing)); |
114 } | 114 } |
115 | 115 |
116 void ScreenCaptureDeviceCore::OnConsumerReportingUtilization( | |
117 int frame_id, | |
118 double utilization) { | |
119 oracle_proxy_->OnConsumerReportingUtilization(frame_id, utilization); | |
miu
2016/12/01 05:25:18
Could |oracle_proxy_| be null here? Not sure wheth
chfremer
2016/12/02 01:28:28
Thanks for raising this.
This makes me realize tha
| |
120 } | |
121 | |
116 void ScreenCaptureDeviceCore::CaptureStarted(bool success) { | 122 void ScreenCaptureDeviceCore::CaptureStarted(bool success) { |
117 DCHECK(thread_checker_.CalledOnValidThread()); | 123 DCHECK(thread_checker_.CalledOnValidThread()); |
118 if (!success) | 124 if (!success) |
119 Error(FROM_HERE, "Failed to start capture machine."); | 125 Error(FROM_HERE, "Failed to start capture machine."); |
120 } | 126 } |
121 | 127 |
122 ScreenCaptureDeviceCore::ScreenCaptureDeviceCore( | 128 ScreenCaptureDeviceCore::ScreenCaptureDeviceCore( |
123 std::unique_ptr<VideoCaptureMachine> capture_machine) | 129 std::unique_ptr<VideoCaptureMachine> capture_machine) |
124 : state_(kIdle), capture_machine_(std::move(capture_machine)) { | 130 : state_(kIdle), capture_machine_(std::move(capture_machine)) { |
125 DCHECK(capture_machine_.get()); | 131 DCHECK(capture_machine_.get()); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 return; | 164 return; |
159 | 165 |
160 if (oracle_proxy_.get()) | 166 if (oracle_proxy_.get()) |
161 oracle_proxy_->ReportError(from_here, reason); | 167 oracle_proxy_->ReportError(from_here, reason); |
162 | 168 |
163 StopAndDeAllocate(); | 169 StopAndDeAllocate(); |
164 TransitionStateTo(kError); | 170 TransitionStateTo(kError); |
165 } | 171 } |
166 | 172 |
167 } // namespace media | 173 } // namespace media |
OLD | NEW |