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#include "Internals.h"
24#include "JSDOMConvertDictionary.h"
25#include "JSDOMConvertEnumeration.h"
26#include "JSDOMWrapper.h"
27#include <wtf/NeverDestroyed.h>
28
29namespace WebCore {
30
31class WEBCORE_TESTSUPPORT_EXPORT JSInternals : public JSDOMWrapper<Internals> {
32public:
33 using Base = JSDOMWrapper<Internals>;
34 static JSInternals* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref<Internals>&& impl)
35 {
36 JSInternals* ptr = new (NotNull, JSC::allocateCell<JSInternals>(globalObject->vm().heap)) JSInternals(structure, *globalObject, WTFMove(impl));
37 ptr->finishCreation(globalObject->vm());
38 return ptr;
39 }
40
41 static JSC::JSObject* createPrototype(JSC::VM&, JSDOMGlobalObject&);
42 static JSC::JSObject* prototype(JSC::VM&, JSDOMGlobalObject&);
43 static Internals* toWrapped(JSC::VM&, JSC::JSValue);
44 static void destroy(JSC::JSCell*);
45
46 DECLARE_INFO;
47
48 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
49 {
50 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
51 }
52
53 static void heapSnapshot(JSCell*, JSC::HeapSnapshotBuilder&);
54protected:
55 JSInternals(JSC::Structure*, JSDOMGlobalObject&, Ref<Internals>&&);
56
57 void finishCreation(JSC::VM&);
58};
59
60class JSInternalsOwner : public JSC::WeakHandleOwner {
61public:
62 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&, const char**);
63 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
64};
65
66inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld&, Internals*)
67{
68 static NeverDestroyed<JSInternalsOwner> owner;
69 return &owner.get();
70}
71
72inline void* wrapperKey(Internals* wrappableObject)
73{
74 return wrappableObject;
75}
76
77WEBCORE_TESTSUPPORT_EXPORT JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, Internals&);
78inline JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, Internals* impl) { return impl ? toJS(state, globalObject, *impl) : JSC::jsNull(); }
79JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject*, Ref<Internals>&&);
80inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<Internals>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
81
82template<> struct JSDOMWrapperConverterTraits<Internals> {
83 using WrapperClass = JSInternals;
84 using ToWrappedReturnType = Internals*;
85};
86String convertEnumerationToString(Internals::PageOverlayType);
87template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, Internals::PageOverlayType);
88
89template<> Optional<Internals::PageOverlayType> parseEnumeration<Internals::PageOverlayType>(JSC::ExecState&, JSC::JSValue);
90template<> const char* expectedEnumerationValues<Internals::PageOverlayType>();
91
92String convertEnumerationToString(Internals::CachePolicy);
93template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, Internals::CachePolicy);
94
95template<> Optional<Internals::CachePolicy> parseEnumeration<Internals::CachePolicy>(JSC::ExecState&, JSC::JSValue);
96template<> const char* expectedEnumerationValues<Internals::CachePolicy>();
97
98String convertEnumerationToString(Internals::ResourceLoadPriority);
99template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, Internals::ResourceLoadPriority);
100
101template<> Optional<Internals::ResourceLoadPriority> parseEnumeration<Internals::ResourceLoadPriority>(JSC::ExecState&, JSC::JSValue);
102template<> const char* expectedEnumerationValues<Internals::ResourceLoadPriority>();
103
104#if ENABLE(MEDIA_SESSION)
105
106String convertEnumerationToString(Internals::MediaSessionInterruptingCategory);
107template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, Internals::MediaSessionInterruptingCategory);
108
109template<> Optional<Internals::MediaSessionInterruptingCategory> parseEnumeration<Internals::MediaSessionInterruptingCategory>(JSC::ExecState&, JSC::JSValue);
110template<> const char* expectedEnumerationValues<Internals::MediaSessionInterruptingCategory>();
111
112#endif
113
114#if ENABLE(MEDIA_SESSION)
115
116String convertEnumerationToString(Internals::MediaControlEvent);
117template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, Internals::MediaControlEvent);
118
119template<> Optional<Internals::MediaControlEvent> parseEnumeration<Internals::MediaControlEvent>(JSC::ExecState&, JSC::JSValue);
120template<> const char* expectedEnumerationValues<Internals::MediaControlEvent>();
121
122#endif
123
124String convertEnumerationToString(Internals::AutoFillButtonType);
125template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, Internals::AutoFillButtonType);
126
127template<> Optional<Internals::AutoFillButtonType> parseEnumeration<Internals::AutoFillButtonType>(JSC::ExecState&, JSC::JSValue);
128template<> const char* expectedEnumerationValues<Internals::AutoFillButtonType>();
129
130String convertEnumerationToString(Internals::UserInterfaceLayoutDirection);
131template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, Internals::UserInterfaceLayoutDirection);
132
133template<> Optional<Internals::UserInterfaceLayoutDirection> parseEnumeration<Internals::UserInterfaceLayoutDirection>(JSC::ExecState&, JSC::JSValue);
134template<> const char* expectedEnumerationValues<Internals::UserInterfaceLayoutDirection>();
135
136String convertEnumerationToString(Internals::BaseWritingDirection);
137template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, Internals::BaseWritingDirection);
138
139template<> Optional<Internals::BaseWritingDirection> parseEnumeration<Internals::BaseWritingDirection>(JSC::ExecState&, JSC::JSValue);
140template<> const char* expectedEnumerationValues<Internals::BaseWritingDirection>();
141
142String convertEnumerationToString(Internals::EventThrottlingBehavior);
143template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, Internals::EventThrottlingBehavior);
144
145template<> Optional<Internals::EventThrottlingBehavior> parseEnumeration<Internals::EventThrottlingBehavior>(JSC::ExecState&, JSC::JSValue);
146template<> const char* expectedEnumerationValues<Internals::EventThrottlingBehavior>();
147
148String convertEnumerationToString(Internals::CompositingPolicy);
149template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, Internals::CompositingPolicy);
150
151template<> Optional<Internals::CompositingPolicy> parseEnumeration<Internals::CompositingPolicy>(JSC::ExecState&, JSC::JSValue);
152template<> const char* expectedEnumerationValues<Internals::CompositingPolicy>();
153
154#if ENABLE(VIDEO)
155
156String convertEnumerationToString(Internals::PlaybackControlsPurpose);
157template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, Internals::PlaybackControlsPurpose);
158
159template<> Optional<Internals::PlaybackControlsPurpose> parseEnumeration<Internals::PlaybackControlsPurpose>(JSC::ExecState&, JSC::JSValue);
160template<> const char* expectedEnumerationValues<Internals::PlaybackControlsPurpose>();
161
162#endif
163
164#if ENABLE(VIDEO)
165
166String convertEnumerationToString(Internals::MediaSessionState);
167template<> JSC::JSString* convertEnumerationToJS(JSC::ExecState&, Internals::MediaSessionState);
168
169template<> Optional<Internals::MediaSessionState> parseEnumeration<Internals::MediaSessionState>(JSC::ExecState&, JSC::JSValue);
170template<> const char* expectedEnumerationValues<Internals::MediaSessionState>();
171
172#endif
173
174#if ENABLE(VIDEO)
175
176template<> WEBCORE_TESTSUPPORT_EXPORT Internals::NowPlayingState convertDictionary<Internals::NowPlayingState>(JSC::ExecState&, JSC::JSValue);
177
178WEBCORE_TESTSUPPORT_EXPORT JSC::JSObject* convertDictionaryToJS(JSC::ExecState&, JSDOMGlobalObject&, const Internals::NowPlayingState&);
179
180#endif
181
182template<> WEBCORE_TESTSUPPORT_EXPORT Internals::FullscreenInsets convertDictionary<Internals::FullscreenInsets>(JSC::ExecState&, JSC::JSValue);
183
184WEBCORE_TESTSUPPORT_EXPORT JSC::JSObject* convertDictionaryToJS(JSC::ExecState&, JSDOMGlobalObject&, const Internals::FullscreenInsets&);
185
186template<> WEBCORE_TESTSUPPORT_EXPORT Internals::HEVCParameterSet convertDictionary<Internals::HEVCParameterSet>(JSC::ExecState&, JSC::JSValue);
187
188WEBCORE_TESTSUPPORT_EXPORT JSC::JSObject* convertDictionaryToJS(JSC::ExecState&, JSDOMGlobalObject&, const Internals::HEVCParameterSet&);
189
190template<> WEBCORE_TESTSUPPORT_EXPORT Internals::AcceleratedAnimation convertDictionary<Internals::AcceleratedAnimation>(JSC::ExecState&, JSC::JSValue);
191
192WEBCORE_TESTSUPPORT_EXPORT JSC::JSObject* convertDictionaryToJS(JSC::ExecState&, JSDOMGlobalObject&, const Internals::AcceleratedAnimation&);
193
194template<> WEBCORE_TESTSUPPORT_EXPORT Internals::CookieData convertDictionary<Internals::CookieData>(JSC::ExecState&, JSC::JSValue);
195
196WEBCORE_TESTSUPPORT_EXPORT JSC::JSObject* convertDictionaryToJS(JSC::ExecState&, JSDOMGlobalObject&, const Internals::CookieData&);
197
198
199} // namespace WebCore
200