tizen beta release
[framework/web/webkit-efl.git] / DerivedSources / WebCore / JSFileEntrySync.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 "JSFileEntrySync.h"
26
27 #include "ExceptionCode.h"
28 #include "File.h"
29 #include "FileEntrySync.h"
30 #include "FileWriterSync.h"
31 #include "JSDOMBinding.h"
32 #include "JSFile.h"
33 #include "JSFileWriterSync.h"
34 #include <runtime/Error.h>
35 #include <wtf/GetPtr.h>
36
37 using namespace JSC;
38
39 namespace WebCore {
40
41 ASSERT_CLASS_FITS_IN_CELL(JSFileEntrySync);
42
43 /* Hash table */
44 #if ENABLE(JIT)
45 #define THUNK_GENERATOR(generator) , generator
46 #else
47 #define THUNK_GENERATOR(generator)
48 #endif
49 #if ENABLE(DFG_JIT)
50 #define INTRINSIC(intrinsic) , intrinsic
51 #else
52 #define INTRINSIC(intrinsic)
53 #endif
54
55 static const HashTableValue JSFileEntrySyncTableValues[] =
56 {
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) }
59 };
60
61 #undef THUNK_GENERATOR
62 static const HashTable JSFileEntrySyncTable = { 2, 1, JSFileEntrySyncTableValues, 0 };
63 /* Hash table for constructor */
64 #if ENABLE(JIT)
65 #define THUNK_GENERATOR(generator) , generator
66 #else
67 #define THUNK_GENERATOR(generator)
68 #endif
69 #if ENABLE(DFG_JIT)
70 #define INTRINSIC(intrinsic) , intrinsic
71 #else
72 #define INTRINSIC(intrinsic)
73 #endif
74
75 static const HashTableValue JSFileEntrySyncConstructorTableValues[] =
76 {
77     { 0, 0, 0, 0 THUNK_GENERATOR(0) INTRINSIC(DFG::NoIntrinsic) }
78 };
79
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) };
83
84 JSFileEntrySyncConstructor::JSFileEntrySyncConstructor(Structure* structure, JSDOMGlobalObject* globalObject)
85     : DOMConstructorObject(structure, globalObject)
86 {
87 }
88
89 void JSFileEntrySyncConstructor::finishCreation(ExecState* exec, JSDOMGlobalObject* globalObject)
90 {
91     Base::finishCreation(exec->globalData());
92     ASSERT(inherits(&s_info));
93     putDirect(exec->globalData(), exec->propertyNames().prototype, JSFileEntrySyncPrototype::self(exec, globalObject), DontDelete | ReadOnly);
94 }
95
96 bool JSFileEntrySyncConstructor::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
97 {
98     return getStaticValueSlot<JSFileEntrySyncConstructor, JSDOMWrapper>(exec, &JSFileEntrySyncConstructorTable, static_cast<JSFileEntrySyncConstructor*>(cell), propertyName, slot);
99 }
100
101 bool JSFileEntrySyncConstructor::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
102 {
103     return getStaticValueDescriptor<JSFileEntrySyncConstructor, JSDOMWrapper>(exec, &JSFileEntrySyncConstructorTable, static_cast<JSFileEntrySyncConstructor*>(object), propertyName, descriptor);
104 }
105
106 /* Hash table for prototype */
107 #if ENABLE(JIT)
108 #define THUNK_GENERATOR(generator) , generator
109 #else
110 #define THUNK_GENERATOR(generator)
111 #endif
112 #if ENABLE(DFG_JIT)
113 #define INTRINSIC(intrinsic) , intrinsic
114 #else
115 #define INTRINSIC(intrinsic)
116 #endif
117
118 static const HashTableValue JSFileEntrySyncPrototypeTableValues[] =
119 {
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) }
123 };
124
125 #undef THUNK_GENERATOR
126 static const HashTable JSFileEntrySyncPrototypeTable = { 5, 3, JSFileEntrySyncPrototypeTableValues, 0 };
127 static const HashTable* getJSFileEntrySyncPrototypeTable(ExecState* exec)
128 {
129     return getHashTableForGlobalData(exec->globalData(), &JSFileEntrySyncPrototypeTable);
130 }
131
132 const ClassInfo JSFileEntrySyncPrototype::s_info = { "FileEntrySyncPrototype", &JSC::JSNonFinalObject::s_info, 0, getJSFileEntrySyncPrototypeTable, CREATE_METHOD_TABLE(JSFileEntrySyncPrototype) };
133
134 JSObject* JSFileEntrySyncPrototype::self(ExecState* exec, JSGlobalObject* globalObject)
135 {
136     return getDOMPrototype<JSFileEntrySync>(exec, globalObject);
137 }
138
139 bool JSFileEntrySyncPrototype::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
140 {
141     JSFileEntrySyncPrototype* thisObject = jsCast<JSFileEntrySyncPrototype*>(cell);
142     return getStaticFunctionSlot<JSObject>(exec, getJSFileEntrySyncPrototypeTable(exec), thisObject, propertyName, slot);
143 }
144
145 bool JSFileEntrySyncPrototype::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
146 {
147     JSFileEntrySyncPrototype* thisObject = jsCast<JSFileEntrySyncPrototype*>(object);
148     return getStaticFunctionDescriptor<JSObject>(exec, getJSFileEntrySyncPrototypeTable(exec), thisObject, propertyName, descriptor);
149 }
150
151 static const HashTable* getJSFileEntrySyncTable(ExecState* exec)
152 {
153     return getHashTableForGlobalData(exec->globalData(), &JSFileEntrySyncTable);
154 }
155
156 const ClassInfo JSFileEntrySync::s_info = { "FileEntrySync", &JSEntrySync::s_info, 0, getJSFileEntrySyncTable , CREATE_METHOD_TABLE(JSFileEntrySync) };
157
158 JSFileEntrySync::JSFileEntrySync(Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<FileEntrySync> impl)
159     : JSEntrySync(structure, globalObject, impl)
160 {
161 }
162
163 void JSFileEntrySync::finishCreation(JSGlobalData& globalData)
164 {
165     Base::finishCreation(globalData);
166     ASSERT(inherits(&s_info));
167 }
168
169 JSObject* JSFileEntrySync::createPrototype(ExecState* exec, JSGlobalObject* globalObject)
170 {
171     return JSFileEntrySyncPrototype::create(exec->globalData(), globalObject, JSFileEntrySyncPrototype::createStructure(exec->globalData(), globalObject, JSEntrySyncPrototype::self(exec, globalObject)));
172 }
173
174 bool JSFileEntrySync::getOwnPropertySlot(JSCell* cell, ExecState* exec, const Identifier& propertyName, PropertySlot& slot)
175 {
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);
179 }
180
181 bool JSFileEntrySync::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor)
182 {
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);
186 }
187
188 JSValue jsFileEntrySyncConstructor(ExecState* exec, JSValue slotBase, const Identifier&)
189 {
190     JSFileEntrySync* domObject = static_cast<JSFileEntrySync*>(asObject(slotBase));
191     return JSFileEntrySync::getConstructor(exec, domObject->globalObject());
192 }
193
194 JSValue JSFileEntrySync::getConstructor(ExecState* exec, JSGlobalObject* globalObject)
195 {
196     return getDOMConstructor<JSFileEntrySyncConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
197 }
198
199 EncodedJSValue JSC_HOST_CALL jsFileEntrySyncPrototypeFunctionFile(ExecState* exec)
200 {
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;
208
209     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->file(ec)));
210     setDOMException(exec, ec);
211     return JSValue::encode(result);
212 }
213
214 EncodedJSValue JSC_HOST_CALL jsFileEntrySyncPrototypeFunctionCreateWriter(ExecState* exec)
215 {
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;
223
224     JSC::JSValue result = toJS(exec, castedThis->globalObject(), WTF::getPtr(imp->createWriter(ec)));
225     setDOMException(exec, ec);
226     return JSValue::encode(result);
227 }
228
229 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, FileEntrySync* impl)
230 {
231     return wrap<JSFileEntrySync>(exec, globalObject, impl);
232 }
233
234 FileEntrySync* toFileEntrySync(JSC::JSValue value)
235 {
236     return value.inherits(&JSFileEntrySync::s_info) ? static_cast<JSFileEntrySync*>(asObject(value))->impl() : 0;
237 }
238
239 }
240
241 #endif // ENABLE(FILE_SYSTEM)