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 #ifndef ImageCapture_h | 5 #ifndef ImageCapture_h |
6 #define ImageCapture_h | 6 #define ImageCapture_h |
7 | 7 |
8 #include "bindings/core/v8/ActiveScriptWrappable.h" | 8 #include "bindings/core/v8/ActiveScriptWrappable.h" |
9 #include "bindings/core/v8/ScriptPromise.h" | 9 #include "bindings/core/v8/ScriptPromise.h" |
10 #include "core/dom/ContextLifecycleObserver.h" | 10 #include "core/dom/ContextLifecycleObserver.h" |
11 #include "core/events/EventTarget.h" | 11 #include "core/events/EventTarget.h" |
12 #include "media/capture/mojo/image_capture.mojom-blink.h" | 12 #include "media/capture/mojo/image_capture.mojom-blink.h" |
13 #include "modules/EventTargetModules.h" | 13 #include "modules/EventTargetModules.h" |
14 #include "modules/ModulesExport.h" | 14 #include "modules/ModulesExport.h" |
15 #include "platform/AsyncMethodRunner.h" | 15 #include "platform/AsyncMethodRunner.h" |
16 #include <memory> | 16 #include <memory> |
17 | 17 |
18 namespace blink { | 18 namespace blink { |
19 | 19 |
20 class ExceptionState; | 20 class ExceptionState; |
21 class MediaStreamTrack; | 21 class MediaStreamTrack; |
22 class PhotoSettings; | 22 class PhotoSettings; |
23 class WebImageCaptureFrameGrabber; | 23 class WebImageCaptureFrameGrabber; |
24 | 24 |
25 // TODO(mcasas): Consideradding a LayoutTest checking that this class is not | 25 // TODO(mcasas): Consideradding a LayoutTest checking that this class is not |
26 // garbage collected while it has event listeners. | 26 // garbage collected while it has event listeners. |
27 class MODULES_EXPORT ImageCapture final : public EventTargetWithInlineData, | 27 class MODULES_EXPORT ImageCapture final |
28 public ActiveScriptWrappable, | 28 : public EventTargetWithInlineData, |
29 public ContextLifecycleObserver { | 29 public ActiveScriptWrappable<ImageCapture>, |
| 30 public ContextLifecycleObserver { |
30 USING_GARBAGE_COLLECTED_MIXIN(ImageCapture); | 31 USING_GARBAGE_COLLECTED_MIXIN(ImageCapture); |
31 DEFINE_WRAPPERTYPEINFO(); | 32 DEFINE_WRAPPERTYPEINFO(); |
32 | 33 |
33 public: | 34 public: |
34 static ImageCapture* create(ExecutionContext*, | 35 static ImageCapture* create(ExecutionContext*, |
35 MediaStreamTrack*, | 36 MediaStreamTrack*, |
36 ExceptionState&); | 37 ExceptionState&); |
37 ~ImageCapture() override; | 38 ~ImageCapture() override; |
38 | 39 |
39 // EventTarget implementation. | 40 // EventTarget implementation. |
(...skipping 30 matching lines...) Expand all Loading... |
70 Member<MediaStreamTrack> m_streamTrack; | 71 Member<MediaStreamTrack> m_streamTrack; |
71 std::unique_ptr<WebImageCaptureFrameGrabber> m_frameGrabber; | 72 std::unique_ptr<WebImageCaptureFrameGrabber> m_frameGrabber; |
72 media::mojom::blink::ImageCapturePtr m_service; | 73 media::mojom::blink::ImageCapturePtr m_service; |
73 | 74 |
74 HeapHashSet<Member<ScriptPromiseResolver>> m_serviceRequests; | 75 HeapHashSet<Member<ScriptPromiseResolver>> m_serviceRequests; |
75 }; | 76 }; |
76 | 77 |
77 } // namespace blink | 78 } // namespace blink |
78 | 79 |
79 #endif // ImageCapture_h | 80 #endif // ImageCapture_h |
OLD | NEW |