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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
118 double utilization) { | 118 double utilization) { |
119 DCHECK(thread_checker_.CalledOnValidThread()); | 119 DCHECK(thread_checker_.CalledOnValidThread()); |
120 DCHECK(oracle_proxy_); | 120 DCHECK(oracle_proxy_); |
121 oracle_proxy_->OnConsumerReportingUtilization(frame_feedback_id, utilization); | 121 oracle_proxy_->OnConsumerReportingUtilization(frame_feedback_id, utilization); |
122 } | 122 } |
123 | 123 |
124 void ScreenCaptureDeviceCore::CaptureStarted(bool success) { | 124 void ScreenCaptureDeviceCore::CaptureStarted(bool success) { |
125 DCHECK(thread_checker_.CalledOnValidThread()); | 125 DCHECK(thread_checker_.CalledOnValidThread()); |
126 if (!success) | 126 if (!success) |
127 Error(FROM_HERE, "Failed to start capture machine."); | 127 Error(FROM_HERE, "Failed to start capture machine."); |
128 else if (oracle_proxy_.get()) | |
miu
2017/02/09 22:21:49
nit: Shouldn't need the ".get()". That's a legacy
braveyao
2017/02/14 01:05:49
Done.
| |
129 oracle_proxy_->ReportStarted(); | |
128 } | 130 } |
129 | 131 |
130 ScreenCaptureDeviceCore::ScreenCaptureDeviceCore( | 132 ScreenCaptureDeviceCore::ScreenCaptureDeviceCore( |
131 std::unique_ptr<VideoCaptureMachine> capture_machine) | 133 std::unique_ptr<VideoCaptureMachine> capture_machine) |
132 : state_(kIdle), capture_machine_(std::move(capture_machine)) { | 134 : state_(kIdle), capture_machine_(std::move(capture_machine)) { |
133 DCHECK(capture_machine_.get()); | 135 DCHECK(capture_machine_.get()); |
134 } | 136 } |
135 | 137 |
136 ScreenCaptureDeviceCore::~ScreenCaptureDeviceCore() { | 138 ScreenCaptureDeviceCore::~ScreenCaptureDeviceCore() { |
137 DCHECK(thread_checker_.CalledOnValidThread()); | 139 DCHECK(thread_checker_.CalledOnValidThread()); |
(...skipping 28 matching lines...) Expand all Loading... | |
166 return; | 168 return; |
167 | 169 |
168 if (oracle_proxy_.get()) | 170 if (oracle_proxy_.get()) |
169 oracle_proxy_->ReportError(from_here, reason); | 171 oracle_proxy_->ReportError(from_here, reason); |
170 | 172 |
171 StopAndDeAllocate(); | 173 StopAndDeAllocate(); |
172 TransitionStateTo(kError); | 174 TransitionStateTo(kError); |
173 } | 175 } |
174 | 176 |
175 } // namespace media | 177 } // namespace media |
OLD | NEW |