• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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(Condition1) || ENABLE(Condition2)
24 
25 #include "JSTestSerializedScriptValueInterface.h"
26 
27 #include "SerializedScriptValue.h"
28 #include "TestSerializedScriptValueInterface.h"
29 #include <wtf/GetPtr.h>
30 
31 using namespace JSC;
32 
33 namespace WebCore {
34 
35 ASSERT_CLASS_FITS_IN_CELL(JSTestSerializedScriptValueInterface);
36 
37 /* Hash table */
38 #if ENABLE(JIT)
39 #define THUNK_GENERATOR(generator) , generator
40 #else
41 #define THUNK_GENERATOR(generator)
42 #endif
43 
44 static const HashTableValue JSTestSerializedScriptValueInterfaceTableValues[3] =
45 {
46     { "value", DontDelete | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfaceValue), (intptr_t)0 THUNK_GENERATOR(0) },
47     { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializedScriptValueInterfaceConstructor), (intptr_t)0 THUNK_GENERATOR(0) },
48     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
49 };
50 
51 #undef THUNK_GENERATOR
52 static JSC_CONST_HASHTABLE HashTable JSTestSerializedScriptValueInterfaceTable = { 4, 3, JSTestSerializedScriptValueInterfaceTableValues, 0 };
53 /* Hash table for constructor */
54 #if ENABLE(JIT)
55 #define THUNK_GENERATOR(generator) , generator
56 #else
57 #define THUNK_GENERATOR(generator)
58 #endif
59 
60 static const HashTableValue JSTestSerializedScriptValueInterfaceConstructorTableValues[1] =
61 {
62     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
63 };
64 
65 #undef THUNK_GENERATOR
66 static JSC_CONST_HASHTABLE HashTable JSTestSerializedScriptValueInterfaceConstructorTable = { 1, 0, JSTestSerializedScriptValueInterfaceConstructorTableValues, 0 };
67 class JSTestSerializedScriptValueInterfaceConstructor : public DOMConstructorObject {
68 public:
69     JSTestSerializedScriptValueInterfaceConstructor(JSC::ExecState*, JSDOMGlobalObject*);
70 
71     virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
72     virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
73     static const JSC::ClassInfo s_info;
createStructure(JSC::JSGlobalData & globalData,JSC::JSValue prototype)74     static PassRefPtr<JSC::Structure> createStructure(JSC::JSGlobalData& globalData, JSC::JSValue prototype)
75     {
76         return JSC::Structure::create(globalData, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount, &s_info);
77     }
78 protected:
79     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
80 };
81 
82 const ClassInfo JSTestSerializedScriptValueInterfaceConstructor::s_info = { "TestSerializedScriptValueInterfaceConstructor", &DOMConstructorObject::s_info, &JSTestSerializedScriptValueInterfaceConstructorTable, 0 };
83 
JSTestSerializedScriptValueInterfaceConstructor(ExecState * exec,JSDOMGlobalObject * globalObject)84 JSTestSerializedScriptValueInterfaceConstructor::JSTestSerializedScriptValueInterfaceConstructor(ExecState* exec, JSDOMGlobalObject* globalObject)
85     : DOMConstructorObject(JSTestSerializedScriptValueInterfaceConstructor::createStructure(globalObject->globalData(), globalObject->objectPrototype()), globalObject)
86 {
87     ASSERT(inherits(&s_info));
88     putDirect(exec->globalData(), exec->propertyNames().prototype, JSTestSerializedScriptValueInterfacePrototype::self(exec, globalObject), DontDelete | ReadOnly);
89 }
90 
getOwnPropertySlot(ExecState * exec,const Identifier & propertyName,PropertySlot & slot)91 bool JSTestSerializedScriptValueInterfaceConstructor::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
92 {
93     return getStaticValueSlot<JSTestSerializedScriptValueInterfaceConstructor, DOMObject>(exec, &JSTestSerializedScriptValueInterfaceConstructorTable, this, propertyName, slot);
94 }
95 
getOwnPropertyDescriptor(ExecState * exec,const Identifier & propertyName,PropertyDescriptor & descriptor)96 bool JSTestSerializedScriptValueInterfaceConstructor::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
97 {
98     return getStaticValueDescriptor<JSTestSerializedScriptValueInterfaceConstructor, DOMObject>(exec, &JSTestSerializedScriptValueInterfaceConstructorTable, this, propertyName, descriptor);
99 }
100 
101 /* Hash table for prototype */
102 #if ENABLE(JIT)
103 #define THUNK_GENERATOR(generator) , generator
104 #else
105 #define THUNK_GENERATOR(generator)
106 #endif
107 
108 static const HashTableValue JSTestSerializedScriptValueInterfacePrototypeTableValues[1] =
109 {
110     { 0, 0, 0, 0 THUNK_GENERATOR(0) }
111 };
112 
113 #undef THUNK_GENERATOR
114 static JSC_CONST_HASHTABLE HashTable JSTestSerializedScriptValueInterfacePrototypeTable = { 1, 0, JSTestSerializedScriptValueInterfacePrototypeTableValues, 0 };
115 const ClassInfo JSTestSerializedScriptValueInterfacePrototype::s_info = { "TestSerializedScriptValueInterfacePrototype", &JSC::JSObjectWithGlobalObject::s_info, &JSTestSerializedScriptValueInterfacePrototypeTable, 0 };
116 
self(ExecState * exec,JSGlobalObject * globalObject)117 JSObject* JSTestSerializedScriptValueInterfacePrototype::self(ExecState* exec, JSGlobalObject* globalObject)
118 {
119     return getDOMPrototype<JSTestSerializedScriptValueInterface>(exec, globalObject);
120 }
121 
122 const ClassInfo JSTestSerializedScriptValueInterface::s_info = { "TestSerializedScriptValueInterface", &DOMObjectWithGlobalPointer::s_info, &JSTestSerializedScriptValueInterfaceTable, 0 };
123 
JSTestSerializedScriptValueInterface(NonNullPassRefPtr<Structure> structure,JSDOMGlobalObject * globalObject,PassRefPtr<TestSerializedScriptValueInterface> impl)124 JSTestSerializedScriptValueInterface::JSTestSerializedScriptValueInterface(NonNullPassRefPtr<Structure> structure, JSDOMGlobalObject* globalObject, PassRefPtr<TestSerializedScriptValueInterface> impl)
125     : DOMObjectWithGlobalPointer(structure, globalObject)
126     , m_impl(impl)
127 {
128     ASSERT(inherits(&s_info));
129 }
130 
createPrototype(ExecState * exec,JSGlobalObject * globalObject)131 JSObject* JSTestSerializedScriptValueInterface::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
132 {
133     return new (exec) JSTestSerializedScriptValueInterfacePrototype(globalObject, JSTestSerializedScriptValueInterfacePrototype::createStructure(globalObject->globalData(), globalObject->objectPrototype()));
134 }
135 
getOwnPropertySlot(ExecState * exec,const Identifier & propertyName,PropertySlot & slot)136 bool JSTestSerializedScriptValueInterface::getOwnPropertySlot(ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
137 {
138     return getStaticValueSlot<JSTestSerializedScriptValueInterface, Base>(exec, &JSTestSerializedScriptValueInterfaceTable, this, propertyName, slot);
139 }
140 
getOwnPropertyDescriptor(ExecState * exec,const Identifier & propertyName,PropertyDescriptor & descriptor)141 bool JSTestSerializedScriptValueInterface::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
142 {
143     return getStaticValueDescriptor<JSTestSerializedScriptValueInterface, Base>(exec, &JSTestSerializedScriptValueInterfaceTable, this, propertyName, descriptor);
144 }
145 
jsTestSerializedScriptValueInterfaceValue(ExecState * exec,JSValue slotBase,const Identifier &)146 JSValue jsTestSerializedScriptValueInterfaceValue(ExecState* exec, JSValue slotBase, const Identifier&)
147 {
148     JSTestSerializedScriptValueInterface* castedThis = static_cast<JSTestSerializedScriptValueInterface*>(asObject(slotBase));
149     UNUSED_PARAM(exec);
150     TestSerializedScriptValueInterface* imp = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
151     JSValue result = imp->value() ? imp->value()->deserialize(exec, castedThis->globalObject()) : jsNull();
152     return result;
153 }
154 
jsTestSerializedScriptValueInterfaceConstructor(ExecState * exec,JSValue slotBase,const Identifier &)155 JSValue jsTestSerializedScriptValueInterfaceConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
156 {
157     JSTestSerializedScriptValueInterface* domObject = static_cast<JSTestSerializedScriptValueInterface*>(asObject(slotBase));
158     return JSTestSerializedScriptValueInterface::getConstructor(exec, domObject->globalObject());
159 }
160 
getConstructor(ExecState * exec,JSGlobalObject * globalObject)161 JSValue JSTestSerializedScriptValueInterface::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
162 {
163     return getDOMConstructor<JSTestSerializedScriptValueInterfaceConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
164 }
165 
toJS(JSC::ExecState * exec,JSDOMGlobalObject * globalObject,TestSerializedScriptValueInterface * object)166 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestSerializedScriptValueInterface* object)
167 {
168     return getDOMObjectWrapper<JSTestSerializedScriptValueInterface>(exec, globalObject, object);
169 }
toTestSerializedScriptValueInterface(JSC::JSValue value)170 TestSerializedScriptValueInterface* toTestSerializedScriptValueInterface(JSC::JSValue value)
171 {
172     return value.inherits(&JSTestSerializedScriptValueInterface::s_info) ? static_cast<JSTestSerializedScriptValueInterface*>(asObject(value))->impl() : 0;
173 }
174 
175 }
176 
177 #endif // ENABLE(Condition1) || ENABLE(Condition2)
178