| 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 : ContextLifecycleObserver(context), m_streamTrack(track) { |
| 272 ContextLifecycleObserver(context), | |
| 273 m_streamTrack(track) { | |
| 274 DCHECK(m_streamTrack); | 272 DCHECK(m_streamTrack); |
| 275 DCHECK(!m_service.is_bound()); | 273 DCHECK(!m_service.is_bound()); |
| 276 | 274 |
| 277 Platform::current()->interfaceProvider()->getInterface( | 275 Platform::current()->interfaceProvider()->getInterface( |
| 278 mojo::GetProxy(&m_service)); | 276 mojo::GetProxy(&m_service)); |
| 279 | 277 |
| 280 m_service.set_connection_error_handler(convertToBaseCallback(WTF::bind( | 278 m_service.set_connection_error_handler(convertToBaseCallback(WTF::bind( |
| 281 &ImageCapture::onServiceConnectionError, wrapWeakPersistent(this)))); | 279 &ImageCapture::onServiceConnectionError, wrapWeakPersistent(this)))); |
| 282 } | 280 } |
| 283 | 281 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 } | 381 } |
| 384 | 382 |
| 385 DEFINE_TRACE(ImageCapture) { | 383 DEFINE_TRACE(ImageCapture) { |
| 386 visitor->trace(m_streamTrack); | 384 visitor->trace(m_streamTrack); |
| 387 visitor->trace(m_serviceRequests); | 385 visitor->trace(m_serviceRequests); |
| 388 EventTargetWithInlineData::trace(visitor); | 386 EventTargetWithInlineData::trace(visitor); |
| 389 ContextLifecycleObserver::trace(visitor); | 387 ContextLifecycleObserver::trace(visitor); |
| 390 } | 388 } |
| 391 | 389 |
| 392 } // namespace blink | 390 } // namespace blink |
| OLD | NEW |