| 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" |
| 11 #include "core/fileapi/Blob.h" | 11 #include "core/fileapi/Blob.h" |
| 12 #include "core/frame/ImageBitmap.h" | 12 #include "core/frame/ImageBitmap.h" |
| 13 #include "modules/EventTargetModules.h" | 13 #include "modules/EventTargetModules.h" |
| 14 #include "modules/imagecapture/MediaSettingsRange.h" | 14 #include "modules/imagecapture/MediaSettingsRange.h" |
| 15 #include "modules/imagecapture/PhotoCapabilities.h" | 15 #include "modules/imagecapture/PhotoCapabilities.h" |
| 16 #include "modules/imagecapture/PhotoSettings.h" | 16 #include "modules/imagecapture/PhotoSettings.h" |
| 17 #include "modules/mediastream/MediaStreamTrack.h" | 17 #include "modules/mediastream/MediaStreamTrack.h" |
| 18 #include "platform/mojo/MojoHelper.h" | 18 #include "platform/mojo/MojoHelper.h" |
| 19 #include "public/platform/InterfaceProvider.h" |
| 19 #include "public/platform/Platform.h" | 20 #include "public/platform/Platform.h" |
| 20 #include "public/platform/ServiceRegistry.h" | |
| 21 #include "public/platform/WebImageCaptureFrameGrabber.h" | 21 #include "public/platform/WebImageCaptureFrameGrabber.h" |
| 22 #include "public/platform/WebMediaStreamTrack.h" | 22 #include "public/platform/WebMediaStreamTrack.h" |
| 23 #include "wtf/PtrUtil.h" | 23 #include "wtf/PtrUtil.h" |
| 24 | 24 |
| 25 namespace blink { | 25 namespace blink { |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 const char kNoServiceError[] = "ImageCapture service unavailable."; | 29 const char kNoServiceError[] = "ImageCapture service unavailable."; |
| 30 | 30 |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 } | 181 } |
| 182 | 182 |
| 183 ImageCapture::ImageCapture(ExecutionContext* context, MediaStreamTrack* track) | 183 ImageCapture::ImageCapture(ExecutionContext* context, MediaStreamTrack* track) |
| 184 : ActiveScriptWrappable(this) | 184 : ActiveScriptWrappable(this) |
| 185 , ContextLifecycleObserver(context) | 185 , ContextLifecycleObserver(context) |
| 186 , m_streamTrack(track) | 186 , m_streamTrack(track) |
| 187 { | 187 { |
| 188 DCHECK(m_streamTrack); | 188 DCHECK(m_streamTrack); |
| 189 DCHECK(!m_service.is_bound()); | 189 DCHECK(!m_service.is_bound()); |
| 190 | 190 |
| 191 Platform::current()->serviceRegistry()->connectToRemoteService(mojo::GetProx
y(&m_service)); | 191 Platform::current()->interfaceProvider()->getInterface(mojo::GetProxy(&m_ser
vice)); |
| 192 | 192 |
| 193 m_service.set_connection_error_handler(convertToBaseCallback(WTF::bind(&Imag
eCapture::onServiceConnectionError, wrapWeakPersistent(this)))); | 193 m_service.set_connection_error_handler(convertToBaseCallback(WTF::bind(&Imag
eCapture::onServiceConnectionError, wrapWeakPersistent(this)))); |
| 194 | 194 |
| 195 } | 195 } |
| 196 | 196 |
| 197 void ImageCapture::onCapabilities(ScriptPromiseResolver* resolver, media::mojom:
:blink::PhotoCapabilitiesPtr capabilities) | 197 void ImageCapture::onCapabilities(ScriptPromiseResolver* resolver, media::mojom:
:blink::PhotoCapabilitiesPtr capabilities) |
| 198 { | 198 { |
| 199 DVLOG(1) << __func__; | 199 DVLOG(1) << __func__; |
| 200 if (!m_serviceRequests.contains(resolver)) | 200 if (!m_serviceRequests.contains(resolver)) |
| 201 return; | 201 return; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 253 |
| 254 DEFINE_TRACE(ImageCapture) | 254 DEFINE_TRACE(ImageCapture) |
| 255 { | 255 { |
| 256 visitor->trace(m_streamTrack); | 256 visitor->trace(m_streamTrack); |
| 257 visitor->trace(m_serviceRequests); | 257 visitor->trace(m_serviceRequests); |
| 258 EventTargetWithInlineData::trace(visitor); | 258 EventTargetWithInlineData::trace(visitor); |
| 259 ContextLifecycleObserver::trace(visitor); | 259 ContextLifecycleObserver::trace(visitor); |
| 260 } | 260 } |
| 261 | 261 |
| 262 } // namespace blink | 262 } // namespace blink |
| OLD | NEW |