Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(562)

Side by Side Diff: third_party/WebKit/Source/modules/imagecapture/ImageCapture.h

Issue 1890313002: MediaStream Image Capture (1): idl and wireframe .h/.cpp/LayoutTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: haraken@ comment: make ImageCapture a ContextLifecycleObserver iso an ActiveDOMObject Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef ImageCapture_h
6 #define ImageCapture_h
7
8 #include "bindings/core/v8/ActiveScriptWrappable.h"
9 #include "bindings/core/v8/ScriptPromise.h"
10 #include "core/dom/ContextLifecycleObserver.h"
11 #include "core/events/EventTarget.h"
12 #include "modules/EventTargetModules.h"
13 #include "modules/ModulesExport.h"
14 #include "platform/AsyncMethodRunner.h"
15
16 namespace blink {
17
18 class ExceptionState;
19 class MediaStreamTrack;
20
21 class MODULES_EXPORT ImageCapture final
22 : public EventTargetWithInlineData
23 , public ActiveScriptWrappable
24 , public ContextLifecycleObserver {
25 USING_GARBAGE_COLLECTED_MIXIN(ImageCapture);
26 DEFINE_WRAPPERTYPEINFO();
27 public:
28 static ImageCapture* create(ExecutionContext*, MediaStreamTrack*, ExceptionS tate&);
29 ~ImageCapture() = default;
30
31 // EventTarget implementation.
32 const AtomicString& interfaceName() const override;
33 ExecutionContext* getExecutionContext() const override;
34
35 // ActiveScriptWrappable implementation.
36 bool hasPendingActivity() const final;
37
38 // ContextLifecycleObserver
39 void contextDestroyed() override;
40
41 MediaStreamTrack* videoStreamTrack() const { return m_streamTrack.get(); }
42
43 ScriptPromise grabFrame(ScriptState*, ExceptionState&);
44
45 DECLARE_VIRTUAL_TRACE();
46
47 private:
48 ImageCapture(ExecutionContext*, MediaStreamTrack*);
49
50 // EventTarget implementation.
51 bool addEventListenerInternal(const AtomicString& eventType, EventListener*, const EventListenerOptions&) override;
52
53 Member<MediaStreamTrack> m_streamTrack;
54 };
55
56 } // namespace blink
57
58 #endif // ImageCapture_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698