| OLD | NEW |
| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 261 |
| 262 // The platform does not know about MediaStreamTrack, so we wrap it up. | 262 // The platform does not know about MediaStreamTrack, so we wrap it up. |
| 263 WebMediaStreamTrack track(m_streamTrack->component()); | 263 WebMediaStreamTrack track(m_streamTrack->component()); |
| 264 m_frameGrabber->grabFrame( | 264 m_frameGrabber->grabFrame( |
| 265 &track, new CallbackPromiseAdapter<ImageBitmap, void>(resolver)); | 265 &track, new CallbackPromiseAdapter<ImageBitmap, void>(resolver)); |
| 266 | 266 |
| 267 return promise; | 267 return promise; |
| 268 } | 268 } |
| 269 | 269 |
| 270 ImageCapture::ImageCapture(ExecutionContext* context, MediaStreamTrack* track) | 270 ImageCapture::ImageCapture(ExecutionContext* context, MediaStreamTrack* track) |
| 271 : ActiveScriptWrappable(this), | 271 : ActiveScriptWrappable(), |
| 272 ContextLifecycleObserver(context), | 272 ContextLifecycleObserver(context), |
| 273 m_streamTrack(track) { | 273 m_streamTrack(track) { |
| 274 DCHECK(m_streamTrack); | 274 DCHECK(m_streamTrack); |
| 275 DCHECK(!m_service.is_bound()); | 275 DCHECK(!m_service.is_bound()); |
| 276 | 276 |
| 277 Platform::current()->interfaceProvider()->getInterface( | 277 Platform::current()->interfaceProvider()->getInterface( |
| 278 mojo::GetProxy(&m_service)); | 278 mojo::GetProxy(&m_service)); |
| 279 | 279 |
| 280 m_service.set_connection_error_handler(convertToBaseCallback(WTF::bind( | 280 m_service.set_connection_error_handler(convertToBaseCallback(WTF::bind( |
| 281 &ImageCapture::onServiceConnectionError, wrapWeakPersistent(this)))); | 281 &ImageCapture::onServiceConnectionError, wrapWeakPersistent(this)))); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 } | 383 } |
| 384 | 384 |
| 385 DEFINE_TRACE(ImageCapture) { | 385 DEFINE_TRACE(ImageCapture) { |
| 386 visitor->trace(m_streamTrack); | 386 visitor->trace(m_streamTrack); |
| 387 visitor->trace(m_serviceRequests); | 387 visitor->trace(m_serviceRequests); |
| 388 EventTargetWithInlineData::trace(visitor); | 388 EventTargetWithInlineData::trace(visitor); |
| 389 ContextLifecycleObserver::trace(visitor); | 389 ContextLifecycleObserver::trace(visitor); |
| 390 } | 390 } |
| 391 | 391 |
| 392 } // namespace blink | 392 } // namespace blink |
| OLD | NEW |