tizen beta release
[framework/web/webkit-efl.git] / DerivedSources / WebCore / JSDirectoryReaderSync.cpp
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(FILE_SYSTEM)
24
25 #include "JSDirectoryReaderSync.h"
26
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>
34
35 using namespace JSC;
36
37 namespace WebCore {
38
39 ASSERT_CLASS_FITS_IN_CELL(JSDirectoryReaderSync);
40
41 /* Hash table */
42 #if ENABLE(JIT)
43 #define THUNK_GENERATOR(generator) , generator
44 #else
45 #define THUNK_GENERATOR(generator)
46 #endif
47 #if ENABLE(DFG_JIT)
48 #define INTRINSIC(intrinsic) , intrinsic
49 #else
50 #define INTRINSIC(intrinsic)
51 #endif
52
53 static const HashTableValue JSDirectoryReaderSyncTableValues[] =
54 {
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) }
57 };
58
59 #undef THUNK_GENERATOR
60 static const HashTable JSDirectoryReaderSyncTable = { 2, 1, JSDirectoryReaderSyncTableValues, 0 };
61 /* Hash table for constructor */
62 #if ENABLE(JIT)
63 #define THUNK_GENERATOR(generator) , generator
64 #else
65 #define THUNK_GENERATOR(generator)
66 #endif
67 #if ENABLE(DFG_JIT)
68 #define INTRINSIC(intrinsic) , intrinsic
69 #else
70 #define INTRINSIC(intrinsic)
71 #endif
72
73 static const HashTableValue JSDirectoryReaderSyncConstructorTableValues[] =
74 {
75     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
76 };
77
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) };
81
82 JSDirectoryReaderSyncConstructor::JSDirectoryReaderSyncConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
83     : DOMConstructorObject(structure, globalObject)
84 {
85 }
86
87 void JSDirectoryReaderSyncConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
88 {
89     Base::finishCreation(exec->globalData());
90     ASSERT(inherits(&s_info));
91     putDirect(exec->globalData(), exec->propertyNames().prototype, JSDirectoryReaderSyncPrototype::self(exec, globalObject), DontDelete | ReadOnly);
92 }
93
94 bool JSDirectoryReaderSyncConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
95 {
96     return getStaticValueSlot<JSDirectoryReaderSyncConstructor, JSDOMWrapper>(exec, &JSDirectoryReaderSyncConstructorTable, static_cast<JSDirectoryReaderSyncConstructor*>(cell), propertyName, slot);
97 }
98
99 bool JSDirectoryReaderSyncConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
100 {
101     return getStaticValueDescriptor<JSDirectoryReaderSyncConstructor, JSDOMWrapper>(exec, &JSDirectoryReaderSyncConstructorTable, static_cast<JSDirectoryReaderSyncConstructor*>(object), propertyName, descriptor);
102 }
103
104 /* Hash table for prototype */
105 #if ENABLE(JIT)
106 #define THUNK_GENERATOR(generator) , generator
107 #else
108 #define THUNK_GENERATOR(generator)
109 #endif
110 #if ENABLE(DFG_JIT)
111 #define INTRINSIC(intrinsic) , intrinsic
112 #else
113 #define INTRINSIC(intrinsic)
114 #endif
115
116 static const HashTableValue JSDirectoryReaderSyncPrototypeTableValues[] =
117 {
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) }
120 };
121
122 #undef THUNK_GENERATOR
123 static const HashTable JSDirectoryReaderSyncPrototypeTable = { 2, 1, JSDirectoryReaderSyncPrototypeTableValues, 0 };
124 static const HashTable* getJSDirectoryReaderSyncPrototypeTable(ExecState* exec)
125 {
126     return getHashTableForGlobalData(exec->globalData(), &JSDirectoryReaderSyncPrototypeTable);
127 }
128
129 const ClassInfo JSDirectoryReaderSyncPrototype::s_info = { "DirectoryReaderSyncPrototype", &JSC::JSNonFinalObject::s_info, 0, getJSDirectoryReaderSyncPrototypeTable, CREATE_METHOD_TABLE(JSDirectoryReaderSyncPrototype) };
130
131 JSObject* JSDirectoryReaderSyncPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
132 {
133     return getDOMPrototype<JSDirectoryReaderSync>(exec, globalObject);
134 }
135
136 bool JSDirectoryReaderSyncPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
137 {
138     JSDirectoryReaderSyncPrototype* thisObject = jsCast<JSDirectoryReaderSyncPrototype*>(cell);
139     return getStaticFunctionSlot<JSObject>(exec, getJSDirectoryReaderSyncPrototypeTable(exec), thisObject, propertyName, slot);
140 }
141
142 bool JSDirectoryReaderSyncPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
143 {
144     JSDirectoryReaderSyncPrototype* thisObject = jsCast<JSDirectoryReaderSyncPrototype*>(object);
145     return getStaticFunctionDescriptor<JSObject>(exec, getJSDirectoryReaderSyncPrototypeTable(exec), thisObject, propertyName, descriptor);
146 }
147
148 static const HashTable* getJSDirectoryReaderSyncTable(ExecState* exec)
149 {
150     return getHashTableForGlobalData(exec->globalData(), &JSDirectoryReaderSyncTable);
151 }
152
153 const ClassInfo JSDirectoryReaderSync::s_info = { "DirectoryReaderSync", &JSDOMWrapper::s_info, 0, getJSDirectoryReaderSyncTable , CREATE_METHOD_TABLE(JSDirectoryReaderSync) };
154
155 JSDirectoryReaderSync::JSDirectoryReaderSync(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<DirectoryReaderSync> impl)
156     : JSDOMWrapper(structure, globalObject)
157     , m_impl(impl.leakRef())
158 {
159 }
160
161 void JSDirectoryReaderSync::finishCreation(JSGlobalData& globalData)
162 {
163     Base::finishCreation(globalData);
164     ASSERT(inherits(&s_info));
165 }
166
167 JSObject* JSDirectoryReaderSync::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
168 {
169     return JSDirectoryReaderSyncPrototype::create(exec->globalData(), globalObject, JSDirectoryReaderSyncPrototype::createStructure(globalObject->globalData(), globalObject, globalObject->objectPrototype()));
170 }
171
172 bool JSDirectoryReaderSync::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
173 {
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);
177 }
178
179 bool JSDirectoryReaderSync::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
180 {
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);
184 }
185
186 JSValue jsDirectoryReaderSyncConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
187 {
188     JSDirectoryReaderSync* domObject = static_cast<JSDirectoryReaderSync*>(asObject(slotBase));
189     return JSDirectoryReaderSync::getConstructor(exec, domObject->globalObject());
190 }
191
192 JSValue JSDirectoryReaderSync::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
193 {
194     return getDOMConstructor<JSDirectoryReaderSyncConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
195 }
196
197 EncodedJSValue JSC_HOST_CALL jsDirectoryReaderSyncPrototypeFunctionReadEntries(ExecState* exec)
198 {
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;
206
207     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->readEntries(ec)));
208     setDOMException(exec, ec);
209     return JSValue::encode(result);
210 }
211
212 static inline bool isObservable(JSDirectoryReaderSync* jsDirectoryReaderSync)
213 {
214     if (jsDirectoryReaderSync->hasCustomProperties())
215         return true;
216     return false;
217 }
218
219 bool JSDirectoryReaderSyncOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
220 {
221     JSDirectoryReaderSync* jsDirectoryReaderSync = static_cast<JSDirectoryReaderSync*>(handle.get().asCell());
222     if (!isObservable(jsDirectoryReaderSync))
223         return false;
224     UNUSED_PARAM(visitor);
225     return false;
226 }
227
228 void JSDirectoryReaderSyncOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
229 {
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();
234 }
235
236 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, DirectoryReaderSync* impl)
237 {
238     return wrap<JSDirectoryReaderSync>(exec, globalObject, impl);
239 }
240
241 DirectoryReaderSync* toDirectoryReaderSync(JSC::JSValue value)
242 {
243     return value.inherits(&JSDirectoryReaderSync::s_info) ? static_cast<JSDirectoryReaderSync*>(asObject(value))->impl() : 0;
244 }
245
246 }
247
248 #endif // ENABLE(FILE_SYSTEM)