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

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

Issue 2062333002: mojo::Callback -> base::Callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 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
« no previous file with comments | « services/shell/tests/connect/connect_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 if (!m_service) { 136 if (!m_service) {
137 resolver->reject(DOMException::create(NotFoundError, kNoServiceError)); 137 resolver->reject(DOMException::create(NotFoundError, kNoServiceError));
138 return promise; 138 return promise;
139 } 139 }
140 140
141 m_serviceRequests.add(resolver); 141 m_serviceRequests.add(resolver);
142 142
143 // m_streamTrack->component()->source()->id() is the renderer "name" of the camera; 143 // m_streamTrack->component()->source()->id() is the renderer "name" of the camera;
144 // TODO(mcasas) consider sending the security origin as well: 144 // TODO(mcasas) consider sending the security origin as well:
145 // scriptState->getExecutionContext()->getSecurityOrigin()->toString() 145 // scriptState->getExecutionContext()->getSecurityOrigin()->toString()
146 m_service->TakePhoto(m_streamTrack->component()->source()->id(), createBaseC allback(bind<String, mojo::WTFArray<uint8_t>>(&ImageCapture::onTakePhoto, this, resolver))); 146 m_service->TakePhoto(m_streamTrack->component()->source()->id(), createBaseC allback(bind<const String&, mojo::WTFArray<uint8_t>>(&ImageCapture::onTakePhoto, this, resolver)));
147 return promise; 147 return promise;
148 } 148 }
149 149
150 ScriptPromise ImageCapture::grabFrame(ScriptState* scriptState, ExceptionState& exceptionState) 150 ScriptPromise ImageCapture::grabFrame(ScriptState* scriptState, ExceptionState& exceptionState)
151 { 151 {
152 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ; 152 ScriptPromiseResolver* resolver = ScriptPromiseResolver::create(scriptState) ;
153 ScriptPromise promise = resolver->promise(); 153 ScriptPromise promise = resolver->promise();
154 154
155 if (trackIsInactive(*m_streamTrack)) { 155 if (trackIsInactive(*m_streamTrack)) {
156 resolver->reject(DOMException::create(InvalidStateError, "The associated Track is in an invalid state.")); 156 resolver->reject(DOMException::create(InvalidStateError, "The associated Track is in an invalid state."));
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 240
241 DEFINE_TRACE(ImageCapture) 241 DEFINE_TRACE(ImageCapture)
242 { 242 {
243 visitor->trace(m_streamTrack); 243 visitor->trace(m_streamTrack);
244 visitor->trace(m_serviceRequests); 244 visitor->trace(m_serviceRequests);
245 EventTargetWithInlineData::trace(visitor); 245 EventTargetWithInlineData::trace(visitor);
246 ContextLifecycleObserver::trace(visitor); 246 ContextLifecycleObserver::trace(visitor);
247 } 247 }
248 248
249 } // namespace blink 249 } // namespace blink
OLDNEW
« no previous file with comments | « services/shell/tests/connect/connect_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698