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 "JSFileEntrySync.h"
27 #include "ExceptionCode.h"
29 #include "FileEntrySync.h"
30 #include "FileWriterSync.h"
31 #include "JSDOMBinding.h"
33 #include "JSFileWriterSync.h"
34 #include <runtime/Error.h>
35 #include <wtf/GetPtr.h>
41 ASSERT_CLASS_FITS_IN_CELL(JSFileEntrySync);
45 #define THUNK_GENERATOR(generator) , generator
47 #define THUNK_GENERATOR(generator)
50 #define INTRINSIC(intrinsic) , intrinsic
52 #define INTRINSIC(intrinsic)
55 static const HashTableValue JSFileEntrySyncTableValues[] =
57 { "constructor", DontEnum | ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsFileEntrySyncConstructor), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
58 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
61 #undef THUNK_GENERATOR
62 static const HashTable JSFileEntrySyncTable = { 2, 1, JSFileEntrySyncTableValues, 0 };
63 /* Hash table for constructor */
65 #define THUNK_GENERATOR(generator) , generator
67 #define THUNK_GENERATOR(generator)
70 #define INTRINSIC(intrinsic) , intrinsic
72 #define INTRINSIC(intrinsic)
75 static const HashTableValue JSFileEntrySyncConstructorTableValues[] =
77 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
80 #undef THUNK_GENERATOR
81 static const HashTable JSFileEntrySyncConstructorTable = { 1, 0, JSFileEntrySyncConstructorTableValues, 0 };
82 const ClassInfo JSFileEntrySyncConstructor::s_info = { "FileEntrySyncConstructor", &DOMConstructorObject::s_info, &JSFileEntrySyncConstructorTable, 0, CREATE_METHOD_TABLE(JSFileEntrySyncConstructor) };
84 JSFileEntrySyncConstructor::JSFileEntrySyncConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
85 : DOMConstructorObject(structure, globalObject)
89 void JSFileEntrySyncConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
91 Base::finishCreation(exec->globalData());
92 ASSERT(inherits(&s_info));
93 putDirect(exec->globalData(), exec->propertyNames().prototype, JSFileEntrySyncPrototype::self(exec, globalObject), DontDelete | ReadOnly);
96 bool JSFileEntrySyncConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
98 return getStaticValueSlot<JSFileEntrySyncConstructor, JSDOMWrapper>(exec, &JSFileEntrySyncConstructorTable, static_cast<JSFileEntrySyncConstructor*>(cell), propertyName, slot);
101 bool JSFileEntrySyncConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
103 return getStaticValueDescriptor<JSFileEntrySyncConstructor, JSDOMWrapper>(exec, &JSFileEntrySyncConstructorTable, static_cast<JSFileEntrySyncConstructor*>(object), propertyName, descriptor);
106 /* Hash table for prototype */
108 #define THUNK_GENERATOR(generator) , generator
110 #define THUNK_GENERATOR(generator)
113 #define INTRINSIC(intrinsic) , intrinsic
115 #define INTRINSIC(intrinsic)
118 static const HashTableValue JSFileEntrySyncPrototypeTableValues[] =
120 { "file", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsFileEntrySyncPrototypeFunctionFile), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
121 { "createWriter", DontDelete | Function, (intptr_t)static_cast<NativeFunction>(jsFileEntrySyncPrototypeFunctionCreateWriter), (intptr_t)0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) },
122 { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
125 #undef THUNK_GENERATOR
126 static const HashTable JSFileEntrySyncPrototypeTable = { 5, 3, JSFileEntrySyncPrototypeTableValues, 0 };
127 static const HashTable* getJSFileEntrySyncPrototypeTable(ExecState* exec)
129 return getHashTableForGlobalData(exec->globalData(), &JSFileEntrySyncPrototypeTable);
132 const ClassInfo JSFileEntrySyncPrototype::s_info = { "FileEntrySyncPrototype", &JSC::JSNonFinalObject::s_info, 0, getJSFileEntrySyncPrototypeTable, CREATE_METHOD_TABLE(JSFileEntrySyncPrototype) };
134 JSObject* JSFileEntrySyncPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
136 return getDOMPrototype<JSFileEntrySync>(exec, globalObject);
139 bool JSFileEntrySyncPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
141 JSFileEntrySyncPrototype* thisObject = jsCast<JSFileEntrySyncPrototype*>(cell);
142 return getStaticFunctionSlot<JSObject>(exec, getJSFileEntrySyncPrototypeTable(exec), thisObject, propertyName, slot);
145 bool JSFileEntrySyncPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
147 JSFileEntrySyncPrototype* thisObject = jsCast<JSFileEntrySyncPrototype*>(object);
148 return getStaticFunctionDescriptor<JSObject>(exec, getJSFileEntrySyncPrototypeTable(exec), thisObject, propertyName, descriptor);
151 static const HashTable* getJSFileEntrySyncTable(ExecState* exec)
153 return getHashTableForGlobalData(exec->globalData(), &JSFileEntrySyncTable);
156 const ClassInfo JSFileEntrySync::s_info = { "FileEntrySync", &JSEntrySync::s_info, 0, getJSFileEntrySyncTable , CREATE_METHOD_TABLE(JSFileEntrySync) };
158 JSFileEntrySync::JSFileEntrySync(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<FileEntrySync> impl)
159 : JSEntrySync(structure, globalObject, impl)
163 void JSFileEntrySync::finishCreation(JSGlobalData& globalData)
165 Base::finishCreation(globalData);
166 ASSERT(inherits(&s_info));
169 JSObject* JSFileEntrySync::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
171 return JSFileEntrySyncPrototype::create(exec->globalData(), globalObject, JSFileEntrySyncPrototype::createStructure(exec->globalData(), globalObject, JSEntrySyncPrototype::self(exec, globalObject)));
174 bool JSFileEntrySync::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
176 JSFileEntrySync* thisObject = jsCast<JSFileEntrySync*>(cell);
177 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
178 return getStaticValueSlot<JSFileEntrySync, Base>(exec, getJSFileEntrySyncTable(exec), thisObject, propertyName, slot);
181 bool JSFileEntrySync::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
183 JSFileEntrySync* thisObject = jsCast<JSFileEntrySync*>(object);
184 ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info);
185 return getStaticValueDescriptor<JSFileEntrySync, Base>(exec, getJSFileEntrySyncTable(exec), thisObject, propertyName, descriptor);
188 JSValue jsFileEntrySyncConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
190 JSFileEntrySync* domObject = static_cast<JSFileEntrySync*>(asObject(slotBase));
191 return JSFileEntrySync::getConstructor(exec, domObject->globalObject());
194 JSValue JSFileEntrySync::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
196 return getDOMConstructor<JSFileEntrySyncConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
199 EncodedJSValue JSC_HOST_CALL jsFileEntrySyncPrototypeFunctionFile(ExecState* exec)
201 JSValue thisValue = exec->hostThisValue();
202 if (!thisValue.inherits(&JSFileEntrySync::s_info))
203 return throwVMTypeError(exec);
204 JSFileEntrySync* castedThis = static_cast<JSFileEntrySync*>(asObject(thisValue));
205 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSFileEntrySync::s_info);
206 FileEntrySync* imp = static_cast<FileEntrySync*>(castedThis->impl());
207 ExceptionCode ec = 0;
209 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->file(ec)));
210 setDOMException(exec, ec);
211 return JSValue::encode(result);
214 EncodedJSValue JSC_HOST_CALL jsFileEntrySyncPrototypeFunctionCreateWriter(ExecState* exec)
216 JSValue thisValue = exec->hostThisValue();
217 if (!thisValue.inherits(&JSFileEntrySync::s_info))
218 return throwVMTypeError(exec);
219 JSFileEntrySync* castedThis = static_cast<JSFileEntrySync*>(asObject(thisValue));
220 ASSERT_GC_OBJECT_INHERITS(castedThis, &JSFileEntrySync::s_info);
221 FileEntrySync* imp = static_cast<FileEntrySync*>(castedThis->impl());
222 ExceptionCode ec = 0;
224 JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->createWriter(ec)));
225 setDOMException(exec, ec);
226 return JSValue::encode(result);
229 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, FileEntrySync* impl)
231 return wrap<JSFileEntrySync>(exec, globalObject, impl);
234 FileEntrySync* toFileEntrySync(JSC::JSValue value)
236 return value.inherits(&JSFileEntrySync::s_info) ? static_cast<JSFileEntrySync*>(asObject(value))->impl() : 0;
241 #endif // ENABLE(FILE_SYSTEM)