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 "MediaStreamTrack.h" |
30 | #include <wtf/NeverDestroyed.h> |
31 | |
32 | namespace WebCore { |
33 | |
34 | class JSMediaStreamTrack : public JSEventTarget { |
35 | public: |
36 | using Base = JSEventTarget; |
37 | using DOMWrapped = MediaStreamTrack; |
38 | static JSMediaStreamTrack* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<MediaStreamTrack>&& impl) |
39 | { |
40 | JSMediaStreamTrack* ptr = new (NotNull, JSC::allocateCell<JSMediaStreamTrack>(globalObject->vm().heap)) JSMediaStreamTrack(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 WEBCORE_EXPORT MediaStreamTrack* 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 | MediaStreamTrack& wrapped() const |
59 | { |
60 | return static_cast<MediaStreamTrack&>(Base::wrapped()); |
61 | } |
62 | protected: |
63 | JSMediaStreamTrack(JSC::Structure*, JSDOMGlobalObject&, Ref<MediaStreamTrack>&&); |
64 | |
65 | void finishCreation(JSC::VM&); |
66 | }; |
67 | |
68 | class JSMediaStreamTrackOwner : public JSC::WeakHandleOwner { |
69 | public: |
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 | |
74 | inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, MediaStreamTrack*) |
75 | { |
76 | static NeverDestroyed<JSMediaStreamTrackOwner> owner; |
77 | return &owner.get(); |
78 | } |
79 | |
80 | inline void* wrapperKey(MediaStreamTrack* wrappableObject) |
81 | { |
82 | return wrappableObject; |
83 | } |
84 | |
85 | JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, MediaStreamTrack&); |
86 | inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, MediaStreamTrack* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); } |
87 | JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<MediaStreamTrack>&&); |
88 | inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<MediaStreamTrack>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); } |
89 | |
90 | template<> struct JSDOMWrapperConverterTraits<MediaStreamTrack> { |
91 | using WrapperClass = JSMediaStreamTrack; |
92 | using ToWrappedReturnType = MediaStreamTrack*; |
93 | }; |
94 | String convertEnumerationToString(MediaStreamTrack::State); |
95 | template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, MediaStreamTrack::State); |
96 | |
97 | template<> Optional<MediaStreamTrack::State> parseEnumeration<MediaStreamTrack::State>(JSC::ExecState&, JSC::JSValue); |
98 | template<> const char* expectedEnumerationValues<MediaStreamTrack::State>(); |
99 | |
100 | #if ENABLE(MEDIA_STREAM) |
101 | |
102 | template<> MediaStreamTrack::TrackCapabilities convertDictionary<MediaStreamTrack::TrackCapabilities>(JSC::ExecState&, JSC::JSValue); |
103 | |
104 | JSC::JSObject* convertDictionaryToJS(JSC::ExecState&, JSDOMGlobalObject&, const MediaStreamTrack::TrackCapabilities&); |
105 | |
106 | #endif |
107 | |
108 | #if ENABLE(MEDIA_STREAM) |
109 | |
110 | template<> MediaStreamTrack::TrackSettings convertDictionary<MediaStreamTrack::TrackSettings>(JSC::ExecState&, JSC::JSValue); |
111 | |
112 | JSC::JSObject* convertDictionaryToJS(JSC::ExecState&, JSDOMGlobalObject&, const MediaStreamTrack::TrackSettings&); |
113 | |
114 | #endif |
115 | |
116 | |
117 | } // namespace WebCore |
118 | |
119 | #endif // ENABLE(MEDIA_STREAM) |
120 | |