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

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

Issue 2091713002: Specialize base::IsWeakReceiver for Blink weak pointers to support base::Bind (1/5) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: +#include for build fix 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
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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 ImageCapture::ImageCapture(ExecutionContext* context, MediaStreamTrack* track) 177 ImageCapture::ImageCapture(ExecutionContext* context, MediaStreamTrack* track)
178 : ActiveScriptWrappable(this) 178 : ActiveScriptWrappable(this)
179 , ContextLifecycleObserver(context) 179 , ContextLifecycleObserver(context)
180 , m_streamTrack(track) 180 , m_streamTrack(track)
181 { 181 {
182 DCHECK(m_streamTrack); 182 DCHECK(m_streamTrack);
183 DCHECK(!m_service.is_bound()); 183 DCHECK(!m_service.is_bound());
184 184
185 Platform::current()->serviceRegistry()->connectToRemoteService(mojo::GetProx y(&m_service)); 185 Platform::current()->serviceRegistry()->connectToRemoteService(mojo::GetProx y(&m_service));
186 186
187 m_service.set_connection_error_handler(createBaseCallback(bind(&ImageCapture ::onServiceConnectionError, WeakPersistentThisPointer<ImageCapture>(this)))); 187 m_service.set_connection_error_handler(createBaseCallback(bind(&ImageCapture ::onServiceConnectionError, wrapWeakPersistent(this))));
188 188
189 } 189 }
190 190
191 void ImageCapture::onCapabilities(ScriptPromiseResolver* resolver, media::mojom: :blink::PhotoCapabilitiesPtr capabilities) 191 void ImageCapture::onCapabilities(ScriptPromiseResolver* resolver, media::mojom: :blink::PhotoCapabilitiesPtr capabilities)
192 { 192 {
193 DVLOG(1) << __FUNCTION__; 193 DVLOG(1) << __FUNCTION__;
194 if (!m_serviceRequests.contains(resolver)) 194 if (!m_serviceRequests.contains(resolver))
195 return; 195 return;
196 if (capabilities.is_null()) { 196 if (capabilities.is_null()) {
197 resolver->reject(DOMException::create(UnknownError, "platform error")); 197 resolver->reject(DOMException::create(UnknownError, "platform error"));
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 DEFINE_TRACE(ImageCapture) 242 DEFINE_TRACE(ImageCapture)
243 { 243 {
244 visitor->trace(m_streamTrack); 244 visitor->trace(m_streamTrack);
245 visitor->trace(m_serviceRequests); 245 visitor->trace(m_serviceRequests);
246 EventTargetWithInlineData::trace(visitor); 246 EventTargetWithInlineData::trace(visitor);
247 ContextLifecycleObserver::trace(visitor); 247 ContextLifecycleObserver::trace(visitor);
248 } 248 }
249 249
250 } // namespace blink 250 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/geolocation/Geolocation.cpp ('k') | third_party/WebKit/Source/modules/nfc/NFC.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698