1/*
2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#pragma once
22
23#if ENABLE(MEDIA_STREAM)
24
25#include "JSDOMConvertDictionary.h"
26#include "JSDOMConvertEnumeration.h"
27#include "JSDOMWrapper.h"
28#include "JSEventTarget.h"
29#include "MediaRecorder.h"
30#include <wtf/NeverDestroyed.h>
31
32namespace WebCore {
33
34class JSMediaRecorder : public JSEventTarget {
35public:
36 using Base = JSEventTarget;
37 using DOMWrapped = MediaRecorder;
38 static JSMediaRecorder* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<MediaRecorder>&& impl)
39 {
40 JSMediaRecorder* ptr = new (NotNull, JSC::allocateCell<JSMediaRecorder>(globalObject->vm().heap)) JSMediaRecorder(structure, *globalObject, WTFMove(impl));
41 ptr->finishCreation(globalObject->vm());
42 return ptr;
43 }
44
45 static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&);
46 static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&);
47 static MediaRecorder* toWrapped(JSC::VM&, JSC::JSValue);
48
49 DECLARE_INFO;
50
51 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
52 {
53 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
54 }
55
56 static JSC::JSValue getConstructor(JSC::VM&, const JSC::JSGlobalObject*);
57 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&);
58 MediaRecorder& wrapped() const
59 {
60 return static_cast<MediaRecorder&>(Base::wrapped());
61 }
62protected:
63 JSMediaRecorder(JSC::Structure*, JSDOMGlobalObject&, Ref<MediaRecorder>&&);
64
65 void finishCreation(JSC::VM&);
66};
67
68class JSMediaRecorderOwner : public JSC::WeakHandleOwner {
69public:
70 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**);
71 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
72};
73
74inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, MediaRecorder*)
75{
76 static NeverDestroyed<JSMediaRecorderOwner> owner;
77 return &owner.get();
78}
79
80inline void* wrapperKey(MediaRecorder* wrappableObject)
81{
82 return wrappableObject;
83}
84
85JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, MediaRecorder&);
86inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, MediaRecorder* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
87JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<MediaRecorder>&&);
88inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<MediaRecorder>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
89
90template<> struct JSDOMWrapperConverterTraits<MediaRecorder> {
91 using WrapperClass = JSMediaRecorder;
92 using ToWrappedReturnType = MediaRecorder*;
93};
94String convertEnumerationToString(MediaRecorder::RecordingState);
95template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, MediaRecorder::RecordingState);
96
97template<> Optional<MediaRecorder::RecordingState> parseEnumeration<MediaRecorder::RecordingState>(JSC::ExecState&, JSC::JSValue);
98template<> const char* expectedEnumerationValues<MediaRecorder::RecordingState>();
99
100template<> MediaRecorder::Options convertDictionary<MediaRecorder::Options>(JSC::ExecState&, JSC::JSValue);
101
102
103} // namespace WebCore
104
105#endif // ENABLE(MEDIA_STREAM)
106