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