Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp

Issue 2846843002: [blink] Unique pointers in Platform.h (Closed)
Patch Set: fix compilation (and again) Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "modules/imagecapture/ImageCapture.h" 5 #include "modules/imagecapture/ImageCapture.h"
6 6
7 #include "bindings/core/v8/CallbackPromiseAdapter.h" 7 #include "bindings/core/v8/CallbackPromiseAdapter.h"
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "core/dom/DOMException.h" 9 #include "core/dom/DOMException.h"
10 #include "core/dom/ExceptionCode.h" 10 #include "core/dom/ExceptionCode.h"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 ScriptPromise promise = resolver->Promise(); 218 ScriptPromise promise = resolver->Promise();
219 219
220 if (TrackIsInactive(*stream_track_)) { 220 if (TrackIsInactive(*stream_track_)) {
221 resolver->Reject(DOMException::Create( 221 resolver->Reject(DOMException::Create(
222 kInvalidStateError, "The associated Track is in an invalid state.")); 222 kInvalidStateError, "The associated Track is in an invalid state."));
223 return promise; 223 return promise;
224 } 224 }
225 225
226 // Create |m_frameGrabber| the first time. 226 // Create |m_frameGrabber| the first time.
227 if (!frame_grabber_) { 227 if (!frame_grabber_) {
228 frame_grabber_ = 228 frame_grabber_ = Platform::Current()->CreateImageCaptureFrameGrabber();
229 WTF::WrapUnique(Platform::Current()->CreateImageCaptureFrameGrabber());
230 } 229 }
231 230
232 if (!frame_grabber_) { 231 if (!frame_grabber_) {
233 resolver->Reject(DOMException::Create( 232 resolver->Reject(DOMException::Create(
234 kUnknownError, "Couldn't create platform resources")); 233 kUnknownError, "Couldn't create platform resources"));
235 return promise; 234 return promise;
236 } 235 }
237 236
238 // The platform does not know about MediaStreamTrack, so we wrap it up. 237 // The platform does not know about MediaStreamTrack, so we wrap it up.
239 WebMediaStreamTrack track(stream_track_->Component()); 238 WebMediaStreamTrack track(stream_track_->Component());
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 visitor->Trace(stream_track_); 660 visitor->Trace(stream_track_);
662 visitor->Trace(capabilities_); 661 visitor->Trace(capabilities_);
663 visitor->Trace(settings_); 662 visitor->Trace(settings_);
664 visitor->Trace(current_constraints_); 663 visitor->Trace(current_constraints_);
665 visitor->Trace(service_requests_); 664 visitor->Trace(service_requests_);
666 EventTargetWithInlineData::Trace(visitor); 665 EventTargetWithInlineData::Trace(visitor);
667 ContextLifecycleObserver::Trace(visitor); 666 ContextLifecycleObserver::Trace(visitor);
668 } 667 }
669 668
670 } // namespace blink 669 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698