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

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

Issue 2846843002: [blink] Unique pointers in Platform.h (Closed)
Patch Set: fix content_shell compilation 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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 visitor->Trace(stream_track_); 652 visitor->Trace(stream_track_);
654 visitor->Trace(capabilities_); 653 visitor->Trace(capabilities_);
655 visitor->Trace(settings_); 654 visitor->Trace(settings_);
656 visitor->Trace(current_constraints_); 655 visitor->Trace(current_constraints_);
657 visitor->Trace(service_requests_); 656 visitor->Trace(service_requests_);
658 EventTargetWithInlineData::Trace(visitor); 657 EventTargetWithInlineData::Trace(visitor);
659 ContextLifecycleObserver::Trace(visitor); 658 ContextLifecycleObserver::Trace(visitor);
660 } 659 }
661 660
662 } // namespace blink 661 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698