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#include "config.h"
22
23#if ENABLE(WEBGL)
24
25#include "JSWebGLCompressedTextureASTC.h"
26
27#include "JSDOMBinding.h"
28#include "JSDOMConvertSequences.h"
29#include "JSDOMConvertStrings.h"
30#include "JSDOMExceptionHandling.h"
31#include "JSDOMGlobalObject.h"
32#include "JSDOMOperation.h"
33#include "JSDOMWrapperCache.h"
34#include "ScriptExecutionContext.h"
35#include <JavaScriptCore/HeapSnapshotBuilder.h>
36#include <JavaScriptCore/JSArray.h>
37#include <JavaScriptCore/JSCInlines.h>
38#include <wtf/GetPtr.h>
39#include <wtf/PointerPreparations.h>
40#include <wtf/URL.h>
41
42
43namespace WebCore {
44using namespace JSC;
45
46// Functions
47
48JSC::EncodedJSValue JSC_HOST_CALL jsWebGLCompressedTextureASTCPrototypeFunctionGetSupportedProfiles(JSC::ExecState*);
49
50class JSWebGLCompressedTextureASTCPrototype : public JSC::JSNonFinalObject {
51public:
52 using Base = JSC::JSNonFinalObject;
53 static JSWebGLCompressedTextureASTCPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
54 {
55 JSWebGLCompressedTextureASTCPrototype* ptr = new (NotNull, JSC::allocateCell<JSWebGLCompressedTextureASTCPrototype>(vm.heap)) JSWebGLCompressedTextureASTCPrototype(vm, globalObject, structure);
56 ptr->finishCreation(vm);
57 return ptr;
58 }
59
60 DECLARE_INFO;
61 static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
62 {
63 return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
64 }
65
66private:
67 JSWebGLCompressedTextureASTCPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
68 : JSC::JSNonFinalObject(vm, structure)
69 {
70 }
71
72 void finishCreation(JSC::VM&);
73};
74
75/* Hash table for prototype */
76
77static const HashTableValue JSWebGLCompressedTextureASTCPrototypeTableValues[] =
78{
79 { "getSupportedProfiles", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsWebGLCompressedTextureASTCPrototypeFunctionGetSupportedProfiles), (intptr_t) (0) } },
80 { "COMPRESSED_RGBA_ASTC_4x4_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93B0) } },
81 { "COMPRESSED_RGBA_ASTC_5x4_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93B1) } },
82 { "COMPRESSED_RGBA_ASTC_5x5_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93B2) } },
83 { "COMPRESSED_RGBA_ASTC_6x5_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93B3) } },
84 { "COMPRESSED_RGBA_ASTC_6x6_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93B4) } },
85 { "COMPRESSED_RGBA_ASTC_8x5_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93B5) } },
86 { "COMPRESSED_RGBA_ASTC_8x6_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93B6) } },
87 { "COMPRESSED_RGBA_ASTC_8x8_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93B7) } },
88 { "COMPRESSED_RGBA_ASTC_10x5_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93B8) } },
89 { "COMPRESSED_RGBA_ASTC_10x6_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93B9) } },
90 { "COMPRESSED_RGBA_ASTC_10x8_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93BA) } },
91 { "COMPRESSED_RGBA_ASTC_10x10_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93BB) } },
92 { "COMPRESSED_RGBA_ASTC_12x10_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93BC) } },
93 { "COMPRESSED_RGBA_ASTC_12x12_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93BD) } },
94 { "COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93D0) } },
95 { "COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93D1) } },
96 { "COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93D2) } },
97 { "COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93D3) } },
98 { "COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93D4) } },
99 { "COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93D5) } },
100 { "COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93D6) } },
101 { "COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93D7) } },
102 { "COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93D8) } },
103 { "COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93D9) } },
104 { "COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93DA) } },
105 { "COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93DB) } },
106 { "COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93DC) } },
107 { "COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR", JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x93DD) } },
108};
109
110const ClassInfo JSWebGLCompressedTextureASTCPrototype::s_info = { "WebGLCompressedTextureASTCPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSWebGLCompressedTextureASTCPrototype) };
111
112void JSWebGLCompressedTextureASTCPrototype::finishCreation(VM& vm)
113{
114 Base::finishCreation(vm);
115 reifyStaticProperties(vm, JSWebGLCompressedTextureASTC::info(), JSWebGLCompressedTextureASTCPrototypeTableValues, *this);
116}
117
118const ClassInfo JSWebGLCompressedTextureASTC::s_info = { "WebGLCompressedTextureASTC", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSWebGLCompressedTextureASTC) };
119
120JSWebGLCompressedTextureASTC::JSWebGLCompressedTextureASTC(Structure* structure, JSDOMGlobalObject& globalObject, Ref<WebGLCompressedTextureASTC>&& impl)
121 : JSDOMWrapper<WebGLCompressedTextureASTC>(structure, globalObject, WTFMove(impl))
122{
123}
124
125void JSWebGLCompressedTextureASTC::finishCreation(VM& vm)
126{
127 Base::finishCreation(vm);
128 ASSERT(inherits(vm, info()));
129
130}
131
132JSObject* JSWebGLCompressedTextureASTC::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
133{
134 return JSWebGLCompressedTextureASTCPrototype::create(vm, &globalObject, JSWebGLCompressedTextureASTCPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
135}
136
137JSObject* JSWebGLCompressedTextureASTC::prototype(VM& vm, JSDOMGlobalObject& globalObject)
138{
139 return getDOMPrototype<JSWebGLCompressedTextureASTC>(vm, globalObject);
140}
141
142void JSWebGLCompressedTextureASTC::destroy(JSC::JSCell* cell)
143{
144 JSWebGLCompressedTextureASTC* thisObject = static_cast<JSWebGLCompressedTextureASTC*>(cell);
145 thisObject->JSWebGLCompressedTextureASTC::~JSWebGLCompressedTextureASTC();
146}
147
148template<> inline JSWebGLCompressedTextureASTC* IDLOperation<JSWebGLCompressedTextureASTC>::cast(ExecState& state)
149{
150 return jsDynamicCast<JSWebGLCompressedTextureASTC*>(state.vm(), state.thisValue());
151}
152
153static inline JSC::EncodedJSValue jsWebGLCompressedTextureASTCPrototypeFunctionGetSupportedProfilesBody(JSC::ExecState* state, typename IDLOperation<JSWebGLCompressedTextureASTC>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
154{
155 UNUSED_PARAM(state);
156 UNUSED_PARAM(throwScope);
157 auto& impl = castedThis->wrapped();
158 return JSValue::encode(toJS<IDLSequence<IDLDOMString>>(*state, *castedThis->globalObject(), impl.getSupportedProfiles()));
159}
160
161EncodedJSValue JSC_HOST_CALL jsWebGLCompressedTextureASTCPrototypeFunctionGetSupportedProfiles(ExecState* state)
162{
163 return IDLOperation<JSWebGLCompressedTextureASTC>::call<jsWebGLCompressedTextureASTCPrototypeFunctionGetSupportedProfilesBody>(*state, "getSupportedProfiles");
164}
165
166void JSWebGLCompressedTextureASTC::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder)
167{
168 auto* thisObject = jsCast<JSWebGLCompressedTextureASTC*>(cell);
169 builder.setWrappedObjectForCell(cell, &thisObject->wrapped());
170 if (thisObject->scriptExecutionContext())
171 builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
172 Base::heapSnapshot(cell, builder);
173}
174
175bool JSWebGLCompressedTextureASTCOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason)
176{
177 auto* jsWebGLCompressedTextureASTC = jsCast<JSWebGLCompressedTextureASTC*>(handle.slot()->asCell());
178 WebGLRenderingContextBase* root = WTF::getPtr(jsWebGLCompressedTextureASTC->wrapped().context());
179 if (UNLIKELY(reason))
180 *reason = "Reachable from WebGLCompressedTextureASTC";
181 return visitor.containsOpaqueRoot(root);
182}
183
184void JSWebGLCompressedTextureASTCOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
185{
186 auto* jsWebGLCompressedTextureASTC = static_cast<JSWebGLCompressedTextureASTC*>(handle.slot()->asCell());
187 auto& world = *static_cast<DOMWrapperWorld*>(context);
188 uncacheWrapper(world, &jsWebGLCompressedTextureASTC->wrapped(), jsWebGLCompressedTextureASTC);
189}
190
191#if ENABLE(BINDING_INTEGRITY)
192#if PLATFORM(WIN)
193#pragma warning(disable: 4483)
194extern "C" { extern void (*const __identifier("??_7WebGLCompressedTextureASTC@WebCore@@6B@")[])(); }
195#else
196extern "C" { extern void* _ZTVN7WebCore26WebGLCompressedTextureASTCE[]; }
197#endif
198#endif
199
200JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<WebGLCompressedTextureASTC>&& impl)
201{
202
203#if ENABLE(BINDING_INTEGRITY)
204 void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
205#if PLATFORM(WIN)
206 void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(__identifier("??_7WebGLCompressedTextureASTC@WebCore@@6B@"));
207#else
208 void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(&_ZTVN7WebCore26WebGLCompressedTextureASTCE[2]);
209#endif
210
211 // If this fails WebGLCompressedTextureASTC does not have a vtable, so you need to add the
212 // ImplementationLacksVTable attribute to the interface definition
213 static_assert(std::is_polymorphic<WebGLCompressedTextureASTC>::value, "WebGLCompressedTextureASTC is not polymorphic");
214
215 // If you hit this assertion you either have a use after free bug, or
216 // WebGLCompressedTextureASTC has subclasses. If WebGLCompressedTextureASTC has subclasses that get passed
217 // to toJS() we currently require WebGLCompressedTextureASTC you to opt out of binding hardening
218 // by adding the SkipVTableValidation attribute to the interface IDL definition
219 RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
220#endif
221 return createWrapper<WebGLCompressedTextureASTC>(globalObject, WTFMove(impl));
222}
223
224JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, WebGLCompressedTextureASTC& impl)
225{
226 return wrap(state, globalObject, impl);
227}
228
229WebGLCompressedTextureASTC* JSWebGLCompressedTextureASTC::toWrapped(JSC::VM& vm, JSC::JSValue value)
230{
231 if (auto* wrapper = jsDynamicCast<JSWebGLCompressedTextureASTC*>(vm, value))
232 return &wrapper->wrapped();
233 return nullptr;
234}
235
236}
237
238#endif // ENABLE(WEBGL)
239