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/mojo/interfaces/image_capture.mojom-blink.h" | 12 #include "media/mojo/interfaces/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> | |
17 | 16 |
18 namespace blink { | 17 namespace blink { |
19 | 18 |
20 class ExceptionState; | 19 class ExceptionState; |
21 class MediaStreamTrack; | 20 class MediaStreamTrack; |
22 class PhotoSettings; | 21 class PhotoSettings; |
23 class WebImageCaptureFrameGrabber; | 22 class WebImageCaptureFrameGrabber; |
24 | 23 |
25 // TODO(mcasas): Consideradding a LayoutTest checking that this class is not | 24 // TODO(mcasas): Consideradding a LayoutTest checking that this class is not |
26 // garbage collected while it has event listeners. | 25 // garbage collected while it has event listeners. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 57 |
59 private: | 58 private: |
60 ImageCapture(ExecutionContext*, MediaStreamTrack*); | 59 ImageCapture(ExecutionContext*, MediaStreamTrack*); |
61 | 60 |
62 void onCapabilities(ScriptPromiseResolver*, media::mojom::blink::PhotoCapabi
litiesPtr); | 61 void onCapabilities(ScriptPromiseResolver*, media::mojom::blink::PhotoCapabi
litiesPtr); |
63 void onSetOptions(ScriptPromiseResolver*, bool); | 62 void onSetOptions(ScriptPromiseResolver*, bool); |
64 void onTakePhoto(ScriptPromiseResolver*, const String& mimeType, mojo::WTFAr
ray<uint8_t> data); | 63 void onTakePhoto(ScriptPromiseResolver*, const String& mimeType, mojo::WTFAr
ray<uint8_t> data); |
65 void onServiceConnectionError(); | 64 void onServiceConnectionError(); |
66 | 65 |
67 Member<MediaStreamTrack> m_streamTrack; | 66 Member<MediaStreamTrack> m_streamTrack; |
68 std::unique_ptr<WebImageCaptureFrameGrabber> m_frameGrabber; | 67 OwnPtr<WebImageCaptureFrameGrabber> m_frameGrabber; |
69 media::mojom::blink::ImageCapturePtr m_service; | 68 media::mojom::blink::ImageCapturePtr m_service; |
70 | 69 |
71 HeapHashSet<Member<ScriptPromiseResolver>> m_serviceRequests; | 70 HeapHashSet<Member<ScriptPromiseResolver>> m_serviceRequests; |
72 }; | 71 }; |
73 | 72 |
74 } // namespace blink | 73 } // namespace blink |
75 | 74 |
76 #endif // ImageCapture_h | 75 #endif // ImageCapture_h |
OLD | NEW |