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 "JSOESTextureFloatLinear.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
38namespace WebCore {
39using namespace JSC;
40
41class JSOESTextureFloatLinearPrototype : public JSC::JSNonFinalObject {
42public:
43 using Base = JSC::JSNonFinalObject;
44 static JSOESTextureFloatLinearPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
45 {
46 JSOESTextureFloatLinearPrototype* ptr = new (NotNull, JSC::allocateCell<JSOESTextureFloatLinearPrototype>(vm.heap)) JSOESTextureFloatLinearPrototype(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
57private:
58 JSOESTextureFloatLinearPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
59 : JSC::JSNonFinalObject(vm, structure)
60 {
61 }
62};
63
64/* Hash table for prototype */
65const ClassInfo JSOESTextureFloatLinearPrototype::s_info = { "OESTextureFloatLinearPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSOESTextureFloatLinearPrototype) };
66
67const ClassInfo JSOESTextureFloatLinear::s_info = { "OESTextureFloatLinear", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSOESTextureFloatLinear) };
68
69JSOESTextureFloatLinear::JSOESTextureFloatLinear(Structure* structure, JSDOMGlobalObject& globalObject, Ref<OESTextureFloatLinear>&& impl)
70 : JSDOMWrapper<OESTextureFloatLinear>(structure, globalObject, WTFMove(impl))
71{
72}
73
74void JSOESTextureFloatLinear::finishCreation(VM& vm)
75{
76 Base::finishCreation(vm);
77 ASSERT(inherits(vm, info()));
78
79}
80
81JSObject* JSOESTextureFloatLinear::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
82{
83 return JSOESTextureFloatLinearPrototype::create(vm, &globalObject, JSOESTextureFloatLinearPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
84}
85
86JSObject* JSOESTextureFloatLinear::prototype(VM& vm, JSDOMGlobalObject& globalObject)
87{
88 return getDOMPrototype<JSOESTextureFloatLinear>(vm, globalObject);
89}
90
91void JSOESTextureFloatLinear::destroy(JSC::JSCell* cell)
92{
93 JSOESTextureFloatLinear* thisObject = static_cast<JSOESTextureFloatLinear*>(cell);
94 thisObject->JSOESTextureFloatLinear::~JSOESTextureFloatLinear();
95}
96
97void JSOESTextureFloatLinear::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder)
98{
99 auto* thisObject = jsCast<JSOESTextureFloatLinear*>(cell);
100 builder.setWrappedObjectForCell(cell, &thisObject->wrapped());
101 if (thisObject->scriptExecutionContext())
102 builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
103 Base::heapSnapshot(cell, builder);
104}
105
106bool JSOESTextureFloatLinearOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason)
107{
108 auto* jsOESTextureFloatLinear = jsCast<JSOESTextureFloatLinear*>(handle.slot()->asCell());
109 WebGLRenderingContextBase* root = WTF::getPtr(jsOESTextureFloatLinear->wrapped().context());
110 if (UNLIKELY(reason))
111 *reason = "Reachable from OESTextureFloatLinear";
112 return visitor.containsOpaqueRoot(root);
113}
114
115void JSOESTextureFloatLinearOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
116{
117 auto* jsOESTextureFloatLinear = static_cast<JSOESTextureFloatLinear*>(handle.slot()->asCell());
118 auto& world = *static_cast<DOMWrapperWorld*>(context);
119 uncacheWrapper(world, &jsOESTextureFloatLinear->wrapped(), jsOESTextureFloatLinear);
120}
121
122#if ENABLE(BINDING_INTEGRITY)
123#if PLATFORM(WIN)
124#pragma warning(disable: 4483)
125extern "C" { extern void (*const __identifier("??_7OESTextureFloatLinear@WebCore@@6B@")[])(); }
126#else
127extern "C" { extern void* _ZTVN7WebCore21OESTextureFloatLinearE[]; }
128#endif
129#endif
130
131JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<OESTextureFloatLinear>&& impl)
132{
133
134#if ENABLE(BINDING_INTEGRITY)
135 void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
136#if PLATFORM(WIN)
137 void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(__identifier("??_7OESTextureFloatLinear@WebCore@@6B@"));
138#else
139 void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(&_ZTVN7WebCore21OESTextureFloatLinearE[2]);
140#endif
141
142 // If this fails OESTextureFloatLinear does not have a vtable, so you need to add the
143 // ImplementationLacksVTable attribute to the interface definition
144 static_assert(std::is_polymorphic<OESTextureFloatLinear>::value, "OESTextureFloatLinear is not polymorphic");
145
146 // If you hit this assertion you either have a use after free bug, or
147 // OESTextureFloatLinear has subclasses. If OESTextureFloatLinear has subclasses that get passed
148 // to toJS() we currently require OESTextureFloatLinear you to opt out of binding hardening
149 // by adding the SkipVTableValidation attribute to the interface IDL definition
150 RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
151#endif
152 return createWrapper<OESTextureFloatLinear>(globalObject, WTFMove(impl));
153}
154
155JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, OESTextureFloatLinear& impl)
156{
157 return wrap(state, globalObject, impl);
158}
159
160OESTextureFloatLinear* JSOESTextureFloatLinear::toWrapped(JSC::VM& vm, JSC::JSValue value)
161{
162 if (auto* wrapper = jsDynamicCast<JSOESTextureFloatLinear*>(vm, value))
163 return &wrapper->wrapped();
164 return nullptr;
165}
166
167}
168
169#endif // ENABLE(WEBGL)
170