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

Unified 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: Added TODO for the mentioned LayoutTests 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/imagecapture/ImageCapture.h
diff --git a/third_party/WebKit/Source/modules/imagecapture/ImageCapture.h b/third_party/WebKit/Source/modules/imagecapture/ImageCapture.h
new file mode 100644
index 0000000000000000000000000000000000000000..fd89bd0d8188d15d642b313885cbcb23a52800ab
--- /dev/null
+++ b/third_party/WebKit/Source/modules/imagecapture/ImageCapture.h
@@ -0,0 +1,60 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ImageCapture_h
+#define ImageCapture_h
+
+#include "bindings/core/v8/ActiveScriptWrappable.h"
+#include "bindings/core/v8/ScriptPromise.h"
+#include "core/dom/ContextLifecycleObserver.h"
+#include "core/events/EventTarget.h"
+#include "modules/EventTargetModules.h"
+#include "modules/ModulesExport.h"
+#include "platform/AsyncMethodRunner.h"
+
+namespace blink {
+
+class ExceptionState;
+class MediaStreamTrack;
+
+// TODO(mcasas): Consideradding a LayoutTest checking that this class is not
+// garbage collected while it has event listeners.
+class MODULES_EXPORT ImageCapture final
+ : public EventTargetWithInlineData
+ , public ActiveScriptWrappable
+ , public ContextLifecycleObserver {
+ USING_GARBAGE_COLLECTED_MIXIN(ImageCapture);
+ DEFINE_WRAPPERTYPEINFO();
+public:
+ static ImageCapture* create(ExecutionContext*, MediaStreamTrack*, ExceptionState&);
+ ~ImageCapture() override;
+
+ // EventTarget implementation.
+ const AtomicString& interfaceName() const override;
+ ExecutionContext* getExecutionContext() const override;
+
+ // ActiveScriptWrappable implementation.
+ bool hasPendingActivity() const final;
+
+ // ContextLifecycleObserver
+ void contextDestroyed() override;
+
+ MediaStreamTrack* videoStreamTrack() const { return m_streamTrack.get(); }
+
+ ScriptPromise grabFrame(ScriptState*, ExceptionState&);
+
+ DECLARE_VIRTUAL_TRACE();
+
+private:
+ ImageCapture(ExecutionContext*, MediaStreamTrack*);
+
+ // EventTarget implementation.
+ bool addEventListenerInternal(const AtomicString& eventType, EventListener*, const EventListenerOptions&) override;
+
+ Member<MediaStreamTrack> m_streamTrack;
+};
+
+} // namespace blink
+
+#endif // ImageCapture_h

Powered by Google App Engine
This is Rietveld 408576698