| 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
|
|
|