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(STREAMS_API)
24
25#include "JSCountQueuingStrategy.h"
26
27#include "CountQueuingStrategyBuiltins.h"
28#include "JSDOMBinding.h"
29#include "JSDOMBuiltinConstructor.h"
30#include "JSDOMExceptionHandling.h"
31#include "JSDOMOperation.h"
32#include "JSDOMWrapperCache.h"
33#include <JavaScriptCore/FunctionPrototype.h>
34#include <JavaScriptCore/JSCInlines.h>
35#include <wtf/GetPtr.h>
36#include <wtf/PointerPreparations.h>
37
38
39namespace WebCore {
40using namespace JSC;
41
42// Functions
43
44
45// Attributes
46
47JSC::EncodedJSValue jsCountQueuingStrategyConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
48bool setJSCountQueuingStrategyConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
49
50class JSCountQueuingStrategyPrototype : public JSC::JSNonFinalObject {
51public:
52 using Base = JSC::JSNonFinalObject;
53 static JSCountQueuingStrategyPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
54 {
55 JSCountQueuingStrategyPrototype* ptr = new (NotNull, JSC::allocateCell<JSCountQueuingStrategyPrototype>(vm.heap)) JSCountQueuingStrategyPrototype(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 JSCountQueuingStrategyPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
68 : JSC::JSNonFinalObject(vm, structure)
69 {
70 }
71
72 void finishCreation(JSC::VM&);
73};
74
75using JSCountQueuingStrategyConstructor = JSDOMBuiltinConstructor<JSCountQueuingStrategy>;
76
77template<> JSValue JSCountQueuingStrategyConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
78{
79 UNUSED_PARAM(vm);
80 return globalObject.functionPrototype();
81}
82
83template<> void JSCountQueuingStrategyConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
84{
85 putDirect(vm, vm.propertyNames->prototype, JSCountQueuingStrategy::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
86 putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("CountQueuingStrategy"_s)), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
87 putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
88}
89
90template<> FunctionExecutable* JSCountQueuingStrategyConstructor::initializeExecutable(VM& vm)
91{
92 return countQueuingStrategyInitializeCountQueuingStrategyCodeGenerator(vm);
93}
94
95template<> const ClassInfo JSCountQueuingStrategyConstructor::s_info = { "CountQueuingStrategy", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCountQueuingStrategyConstructor) };
96
97/* Hash table for prototype */
98
99static const HashTableValue JSCountQueuingStrategyPrototypeTableValues[] =
100{
101 { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsCountQueuingStrategyConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSCountQueuingStrategyConstructor) } },
102 { "size", static_cast<unsigned>(JSC::PropertyAttribute::Builtin), NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(countQueuingStrategySizeCodeGenerator), (intptr_t) (0) } },
103};
104
105const ClassInfo JSCountQueuingStrategyPrototype::s_info = { "CountQueuingStrategyPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCountQueuingStrategyPrototype) };
106
107void JSCountQueuingStrategyPrototype::finishCreation(VM& vm)
108{
109 Base::finishCreation(vm);
110 reifyStaticProperties(vm, JSCountQueuingStrategy::info(), JSCountQueuingStrategyPrototypeTableValues, *this);
111}
112
113const ClassInfo JSCountQueuingStrategy::s_info = { "CountQueuingStrategy", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCountQueuingStrategy) };
114
115JSCountQueuingStrategy::JSCountQueuingStrategy(Structure* structure, JSDOMGlobalObject& globalObject)
116 : JSDOMObject(structure, globalObject) { }
117
118void JSCountQueuingStrategy::finishCreation(VM& vm)
119{
120 Base::finishCreation(vm);
121 ASSERT(inherits(vm, info()));
122
123}
124
125JSObject* JSCountQueuingStrategy::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
126{
127 return JSCountQueuingStrategyPrototype::create(vm, &globalObject, JSCountQueuingStrategyPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
128}
129
130JSObject* JSCountQueuingStrategy::prototype(VM& vm, JSDOMGlobalObject& globalObject)
131{
132 return getDOMPrototype<JSCountQueuingStrategy>(vm, globalObject);
133}
134
135JSValue JSCountQueuingStrategy::getConstructor(VM& vm, const JSGlobalObject* globalObject)
136{
137 return getDOMConstructor<JSCountQueuingStrategyConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
138}
139
140void JSCountQueuingStrategy::destroy(JSC::JSCell* cell)
141{
142 JSCountQueuingStrategy* thisObject = static_cast<JSCountQueuingStrategy*>(cell);
143 thisObject->JSCountQueuingStrategy::~JSCountQueuingStrategy();
144}
145
146template<> inline JSCountQueuingStrategy* IDLOperation<JSCountQueuingStrategy>::cast(ExecState& state)
147{
148 return jsDynamicCast<JSCountQueuingStrategy*>(state.vm(), state.thisValue());
149}
150
151EncodedJSValue jsCountQueuingStrategyConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
152{
153 VM& vm = state->vm();
154 auto throwScope = DECLARE_THROW_SCOPE(vm);
155 auto* prototype = jsDynamicCast<JSCountQueuingStrategyPrototype*>(vm, JSValue::decode(thisValue));
156 if (UNLIKELY(!prototype))
157 return throwVMTypeError(state, throwScope);
158 return JSValue::encode(JSCountQueuingStrategy::getConstructor(state->vm(), prototype->globalObject()));
159}
160
161bool setJSCountQueuingStrategyConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
162{
163 VM& vm = state->vm();
164 auto throwScope = DECLARE_THROW_SCOPE(vm);
165 auto* prototype = jsDynamicCast<JSCountQueuingStrategyPrototype*>(vm, JSValue::decode(thisValue));
166 if (UNLIKELY(!prototype)) {
167 throwVMTypeError(state, throwScope);
168 return false;
169 }
170 // Shadowing a built-in constructor
171 return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue));
172}
173
174
175}
176
177#endif // ENABLE(STREAMS_API)
178