2 This file is part of the WebKit open source project.
3 This file has been generated by generate-bindings.pl. DO NOT MODIFY!
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.
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.
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.
23 #if ENABLE(FILE_SYSTEM)
25 #include "JSDirectoryReaderSync.h"
27 #include "DirectoryReaderSync.h"
28 #include "EntryArraySync.h"
29 #include "ExceptionCode.h"
30 #include "JSDOMBinding.h"
31 #include "JSEntryArraySync.h"
32 #include <runtime/Error.h>
33 #include <wtf/GetPtr.h>
39 ASSERT_CLASS_FITS_IN_CELL(JSDirectoryReaderSync);
43 #define THUNK_GENERATOR(generator) , generator
45 #define THUNK_GENERATOR(generator)
48 #define INTRINSIC(intrinsic) , intrinsic
50 #define INTRINSIC(intrinsic)
53 static const HashTableValue JSDirectoryReaderSyncTableValues[] =
55 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsDirectoryReaderSyncConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
56 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
59 #undef THUNK_GENERATOR
60 static const HashTable JSDirectoryReaderSyncTable = { 2, 1, JSDirectoryReaderSyncTableValues, 0 };
61 /* Hash table for constructor */
63 #define THUNK_GENERATOR(generator) , generator
65 #define THUNK_GENERATOR(generator)
68 #define INTRINSIC(intrinsic) , intrinsic
70 #define INTRINSIC(intrinsic)
73 static const HashTableValue JSDirectoryReaderSyncConstructorTableValues[] =
75 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
78 #undef THUNK_GENERATOR
79 static const HashTable JSDirectoryReaderSyncConstructorTable = { 1, 0, JSDirectoryReaderSyncConstructorTableValues, 0 };
80 const ClassInfo JSDirectoryReaderSyncConstructor::s_info = { "DirectoryReaderSyncConstructor", &DOMConstructorObject::s_info, &JSDirectoryReaderSyncConstructorTable, 0, CREATE_METHOD_TABLE(JSDirectoryReaderSyncConstructor) };
82 JSDirectoryReaderSyncConstructor::JSDirectoryReaderSyncConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
83 : DOMConstructorObject(structure, globalObject)
87 void JSDirectoryReaderSyncConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
89 Base::finishCreation(exec->globalData());
90 ASSERT(inherits(&s_info));
91 putDirect(exec->globalData(), exec->propertyNames().prototype, JSDirectoryReaderSyncPrototype::self(exec, globalObject), DontDelete | ReadOnly);
94 bool JSDirectoryReaderSyncConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
96 return getStaticValueSlot<JSDirectoryReaderSyncConstructor, JSDOMWrapper>(exec, &JSDirectoryReaderSyncConstructorTable, static_cast<JSDirectoryReaderSyncConstructor*>(cell), propertyName, slot);
99 bool JSDirectoryReaderSyncConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
101 return getStaticValueDescriptor<JSDirectoryReaderSyncConstructor, JSDOMWrapper>(exec, &JSDirectoryReaderSyncConstructorTable, static_cast<JSDirectoryReaderSyncConstructor*>(object), propertyName, descriptor);
104 /* Hash table for prototype */
106 #define THUNK_GENERATOR(generator) , generator
108 #define THUNK_GENERATOR(generator)
111 #define INTRINSIC(intrinsic) , intrinsic
113 #define INTRINSIC(intrinsic)
116 static const HashTableValue JSDirectoryReaderSyncPrototypeTableValues[] =
118 { "readEntries", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsDirectoryReaderSyncPrototypeFunctionReadEntries), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
119 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
122 #undef THUNK_GENERATOR
123 static const HashTable JSDirectoryReaderSyncPrototypeTable = { 2, 1, JSDirectoryReaderSyncPrototypeTableValues, 0 };
124 static const HashTable* getJSDirectoryReaderSyncPrototypeTable(ExecState* exec)
126 return getHashTableForGlobalData(exec->globalData(), &JSDirectoryReaderSyncPrototypeTable);
129 const ClassInfo JSDirectoryReaderSyncPrototype::s_info = { "DirectoryReaderSyncPrototype", &JSC::JSNonFinalObject::s_info, 0, getJSDirectoryReaderSyncPrototypeTable, CREATE_METHOD_TABLE(JSDirectoryReaderSyncPrototype) };
131 JSObject* JSDirectoryReaderSyncPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
133 return getDOMPrototype<JSDirectoryReaderSync>(exec, globalObject);
136 bool JSDirectoryReaderSyncPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
138 JSDirectoryReaderSyncPrototype* thisObject = jsCast<JSDirectoryReaderSyncPrototype*>(cell);
139 return getStaticFunctionSlot<JSObject>(exec, getJSDirectoryReaderSyncPrototypeTable(exec), thisObject, propertyName, slot);
142 bool JSDirectoryReaderSyncPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
144 JSDirectoryReaderSyncPrototype* thisObject = jsCast<JSDirectoryReaderSyncPrototype*>(object);
145 return getStaticFunctionDescriptor<JSObject>(exec, getJSDirectoryReaderSyncPrototypeTable(exec), thisObject, propertyName, descriptor);
148 static const HashTable* getJSDirectoryReaderSyncTable(ExecState* exec)
150 return getHashTableForGlobalData(exec->globalData(), &JSDirectoryReaderSyncTable);
153 const ClassInfo JSDirectoryReaderSync::s_info = { "DirectoryReaderSync", &JSDOMWrapper::s_info, 0, getJSDirectoryReaderSyncTable , CREATE_METHOD_TABLE(JSDirectoryReaderSync) };
155 JSDirectoryReaderSync::JSDirectoryReaderSync(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<DirectoryReaderSync> impl)
156 : JSDOMWrapper(structure, globalObject)
157 , m_impl(impl.leakRef())
161 void JSDirectoryReaderSync::finishCreation(JSGlobalData& globalData)
163 Base::finishCreation(globalData);
164 ASSERT(inherits(&s_info));
167 JSObject* JSDirectoryReaderSync::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
169 return JSDirectoryReaderSyncPrototype::create(exec->globalData(), globalObject, JSDirectoryReaderSyncPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
172 bool JSDirectoryReaderSync::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
174 JSDirectoryReaderSync* thisObject = jsCast<JSDirectoryReaderSync*>(cell);
175 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
176 return getStaticValueSlot<JSDirectoryReaderSync, Base>(exec, getJSDirectoryReaderSyncTable(exec), thisObject, propertyName, slot);
179 bool JSDirectoryReaderSync::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
181 JSDirectoryReaderSync* thisObject = jsCast<JSDirectoryReaderSync*>(object);
182 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
183 return getStaticValueDescriptor<JSDirectoryReaderSync, Base>(exec, getJSDirectoryReaderSyncTable(exec), thisObject, propertyName, descriptor);
186 JSValue jsDirectoryReaderSyncConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
188 JSDirectoryReaderSync* domObject = static_cast<JSDirectoryReaderSync*>(asObject(slotBase));
189 return JSDirectoryReaderSync::getConstructor(exec, domObject->globalObject());
192 JSValue JSDirectoryReaderSync::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
194 return getDOMConstructor<JSDirectoryReaderSyncConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
197 EncodedJSValue JSC_HOST_CALL jsDirectoryReaderSyncPrototypeFunctionReadEntries(ExecState* exec)
199 JSValue thisValue = exec->hostThisValue();
200 if (!thisValue.inherits(&JSDirectoryReaderSync::s_info))
201 return throwVMTypeError(exec);
202 JSDirectoryReaderSync* castedThis = static_cast<JSDirectoryReaderSync*>(asObject(thisValue));
203 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSDirectoryReaderSync::s_info);
204 DirectoryReaderSync* imp = static_cast<DirectoryReaderSync*>(castedThis->impl());
205 ExceptionCode ec = 0;
207 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->readEntries(ec)));
208 setDOMException(exec, ec);
209 return JSValue::encode(result);
212 static inline bool isObservable(JSDirectoryReaderSync* jsDirectoryReaderSync)
214 if (jsDirectoryReaderSync->hasCustomProperties())
219 bool JSDirectoryReaderSyncOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
221 JSDirectoryReaderSync* jsDirectoryReaderSync = static_cast<JSDirectoryReaderSync*>(handle.get().asCell());
222 if (!isObservable(jsDirectoryReaderSync))
224 UNUSED_PARAM(visitor);
228 void JSDirectoryReaderSyncOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
230 JSDirectoryReaderSync* jsDirectoryReaderSync = static_cast<JSDirectoryReaderSync*>(handle.get().asCell());
231 DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
232 uncacheWrapper(world, jsDirectoryReaderSync->impl(), jsDirectoryReaderSync);
233 jsDirectoryReaderSync->releaseImpl();
236 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DirectoryReaderSync* impl)
238 return wrap<JSDirectoryReaderSync>(exec, globalObject, impl);
241 DirectoryReaderSync* toDirectoryReaderSync(JSC::JSValue value)
243 return value.inherits(&JSDirectoryReaderSync::s_info) ? static_cast<JSDirectoryReaderSync*>(asObject(value))->impl() : 0;
248 #endif // ENABLE(FILE_SYSTEM)