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 "JSWebGLCompressedTextureS3TC.h" |
26 | |
27 | #include "JSDOMBinding.h" |
28 | #include "JSDOMExceptionHandling.h" |
29 | #include "JSDOMWrapperCache.h" |
30 | #include "ScriptExecutionContext.h" |
31 | #include <JavaScriptCore/HeapSnapshotBuilder.h> |
32 | #include <JavaScriptCore/JSCInlines.h> |
33 | #include <wtf/GetPtr.h> |
34 | #include <wtf/PointerPreparations.h> |
35 | #include <wtf/URL.h> |
36 | |
37 | |
38 | namespace WebCore { |
39 | using namespace JSC; |
40 | |
41 | class JSWebGLCompressedTextureS3TCPrototype : public JSC::JSNonFinalObject { |
42 | public: |
43 | using Base = JSC::JSNonFinalObject; |
44 | static JSWebGLCompressedTextureS3TCPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
45 | { |
46 | JSWebGLCompressedTextureS3TCPrototype* ptr = new (NotNull, JSC::allocateCell<JSWebGLCompressedTextureS3TCPrototype>(vm.heap)) JSWebGLCompressedTextureS3TCPrototype(vm, globalObject, structure); |
47 | ptr->finishCreation(vm); |
48 | return ptr; |
49 | } |
50 | |
51 | DECLARE_INFO; |
52 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
53 | { |
54 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
55 | } |
56 | |
57 | private: |
58 | JSWebGLCompressedTextureS3TCPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
59 | : JSC::JSNonFinalObject(vm, structure) |
60 | { |
61 | } |
62 | |
63 | void finishCreation(JSC::VM&); |
64 | }; |
65 | |
66 | /* Hash table for prototype */ |
67 | |
68 | static const HashTableValue JSWebGLCompressedTextureS3TCPrototypeTableValues[] = |
69 | { |
70 | { "COMPRESSED_RGB_S3TC_DXT1_EXT" , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x83F0) } }, |
71 | { "COMPRESSED_RGBA_S3TC_DXT1_EXT" , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x83F1) } }, |
72 | { "COMPRESSED_RGBA_S3TC_DXT3_EXT" , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x83F2) } }, |
73 | { "COMPRESSED_RGBA_S3TC_DXT5_EXT" , JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(0x83F3) } }, |
74 | }; |
75 | |
76 | const ClassInfo JSWebGLCompressedTextureS3TCPrototype::s_info = { "WebGLCompressedTextureS3TCPrototype" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSWebGLCompressedTextureS3TCPrototype) }; |
77 | |
78 | void JSWebGLCompressedTextureS3TCPrototype::finishCreation(VM& vm) |
79 | { |
80 | Base::finishCreation(vm); |
81 | reifyStaticProperties(vm, JSWebGLCompressedTextureS3TC::info(), JSWebGLCompressedTextureS3TCPrototypeTableValues, *this); |
82 | } |
83 | |
84 | const ClassInfo JSWebGLCompressedTextureS3TC::s_info = { "WebGLCompressedTextureS3TC" , &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSWebGLCompressedTextureS3TC) }; |
85 | |
86 | JSWebGLCompressedTextureS3TC::JSWebGLCompressedTextureS3TC(Structure* structure, JSDOMGlobalObject& globalObject, Ref<WebGLCompressedTextureS3TC>&& impl) |
87 | : JSDOMWrapper<WebGLCompressedTextureS3TC>(structure, globalObject, WTFMove(impl)) |
88 | { |
89 | } |
90 | |
91 | void JSWebGLCompressedTextureS3TC::finishCreation(VM& vm) |
92 | { |
93 | Base::finishCreation(vm); |
94 | ASSERT(inherits(vm, info())); |
95 | |
96 | } |
97 | |
98 | JSObject* JSWebGLCompressedTextureS3TC::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
99 | { |
100 | return JSWebGLCompressedTextureS3TCPrototype::create(vm, &globalObject, JSWebGLCompressedTextureS3TCPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); |
101 | } |
102 | |
103 | JSObject* JSWebGLCompressedTextureS3TC::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
104 | { |
105 | return getDOMPrototype<JSWebGLCompressedTextureS3TC>(vm, globalObject); |
106 | } |
107 | |
108 | void JSWebGLCompressedTextureS3TC::destroy(JSC::JSCell* cell) |
109 | { |
110 | JSWebGLCompressedTextureS3TC* thisObject = static_cast<JSWebGLCompressedTextureS3TC*>(cell); |
111 | thisObject->JSWebGLCompressedTextureS3TC::~JSWebGLCompressedTextureS3TC(); |
112 | } |
113 | |
114 | void JSWebGLCompressedTextureS3TC::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder) |
115 | { |
116 | auto* thisObject = jsCast<JSWebGLCompressedTextureS3TC*>(cell); |
117 | builder.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
118 | if (thisObject->scriptExecutionContext()) |
119 | builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
120 | Base::heapSnapshot(cell, builder); |
121 | } |
122 | |
123 | bool JSWebGLCompressedTextureS3TCOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) |
124 | { |
125 | auto* jsWebGLCompressedTextureS3TC = jsCast<JSWebGLCompressedTextureS3TC*>(handle.slot()->asCell()); |
126 | WebGLRenderingContextBase* root = WTF::getPtr(jsWebGLCompressedTextureS3TC->wrapped().context()); |
127 | if (UNLIKELY(reason)) |
128 | *reason = "Reachable from WebGLCompressedTextureS3TC" ; |
129 | return visitor.containsOpaqueRoot(root); |
130 | } |
131 | |
132 | void JSWebGLCompressedTextureS3TCOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
133 | { |
134 | auto* jsWebGLCompressedTextureS3TC = static_cast<JSWebGLCompressedTextureS3TC*>(handle.slot()->asCell()); |
135 | auto& world = *static_cast<DOMWrapperWorld*>(context); |
136 | uncacheWrapper(world, &jsWebGLCompressedTextureS3TC->wrapped(), jsWebGLCompressedTextureS3TC); |
137 | } |
138 | |
139 | #if ENABLE(BINDING_INTEGRITY) |
140 | #if PLATFORM(WIN) |
141 | #pragma warning(disable: 4483) |
142 | extern "C" { extern void (*const __identifier("??_7WebGLCompressedTextureS3TC@WebCore@@6B@" )[])(); } |
143 | #else |
144 | extern "C" { extern void* _ZTVN7WebCore26WebGLCompressedTextureS3TCE[]; } |
145 | #endif |
146 | #endif |
147 | |
148 | JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<WebGLCompressedTextureS3TC>&& impl) |
149 | { |
150 | |
151 | #if ENABLE(BINDING_INTEGRITY) |
152 | void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr())); |
153 | #if PLATFORM(WIN) |
154 | void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(__identifier("??_7WebGLCompressedTextureS3TC@WebCore@@6B@" )); |
155 | #else |
156 | void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(&_ZTVN7WebCore26WebGLCompressedTextureS3TCE[2]); |
157 | #endif |
158 | |
159 | // If this fails WebGLCompressedTextureS3TC does not have a vtable, so you need to add the |
160 | // ImplementationLacksVTable attribute to the interface definition |
161 | static_assert(std::is_polymorphic<WebGLCompressedTextureS3TC>::value, "WebGLCompressedTextureS3TC is not polymorphic" ); |
162 | |
163 | // If you hit this assertion you either have a use after free bug, or |
164 | // WebGLCompressedTextureS3TC has subclasses. If WebGLCompressedTextureS3TC has subclasses that get passed |
165 | // to toJS() we currently require WebGLCompressedTextureS3TC you to opt out of binding hardening |
166 | // by adding the SkipVTableValidation attribute to the interface IDL definition |
167 | RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); |
168 | #endif |
169 | return createWrapper<WebGLCompressedTextureS3TC>(globalObject, WTFMove(impl)); |
170 | } |
171 | |
172 | JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, WebGLCompressedTextureS3TC& impl) |
173 | { |
174 | return wrap(state, globalObject, impl); |
175 | } |
176 | |
177 | WebGLCompressedTextureS3TC* JSWebGLCompressedTextureS3TC::toWrapped(JSC::VM& vm, JSC::JSValue value) |
178 | { |
179 | if (auto* wrapper = jsDynamicCast<JSWebGLCompressedTextureS3TC*>(vm, value)) |
180 | return &wrapper->wrapped(); |
181 | return nullptr; |
182 | } |
183 | |
184 | } |
185 | |
186 | #endif // ENABLE(WEBGL) |
187 | |