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.
24 #include "JSDOMBinding.h"
26 #include <runtime/JSGlobalObject.h>
27 #include <runtime/JSObject.h>
28 #include <runtime/ObjectPrototype.h>
32 class JSStorage : public JSDOMWrapper {
34 typedef JSDOMWrapper Base;
35 static JSStorage* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<Storage> impl)
37 JSStorage* ptr = new (JSC::allocateCell<JSStorage>(globalObject->globalData().heap)) JSStorage(structure, globalObject, impl);
38 ptr->finishCreation(globalObject->globalData());
42 static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
43 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
44 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
45 static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
46 bool putDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::JSValue, JSC::PutPropertySlot&);
47 static const JSC::ClassInfo s_info;
49 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
51 return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
54 static bool deleteProperty(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&);
55 static void getOwnPropertyNames(JSC::JSObject*, JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties);
56 static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);
57 Storage* impl() const { return m_impl; }
58 void releaseImpl() { m_impl->deref(); m_impl = 0; }
63 JSStorage(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<Storage>);
64 void finishCreation(JSC::JSGlobalData&);
65 static const unsigned StructureFlags = JSC::OverridesGetPropertyNames | JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
67 static bool canGetItemsForName(JSC::ExecState*, Storage*, const JSC::Identifier&);
68 static JSC::JSValue nameGetter(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
71 class JSStorageOwner : public JSC::WeakHandleOwner {
72 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
73 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
76 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, Storage*)
78 DEFINE_STATIC_LOCAL(JSStorageOwner, jsStorageOwner, ());
79 return &jsStorageOwner;
82 inline void* wrapperContext(DOMWrapperWorld* world, Storage*)
87 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, Storage*);
88 Storage* toStorage(JSC::JSValue);
90 class JSStoragePrototype : public JSC::JSNonFinalObject {
92 typedef JSC::JSNonFinalObject Base;
93 static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
94 static JSStoragePrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
96 JSStoragePrototype* ptr = new (JSC::allocateCell<JSStoragePrototype>(globalData.heap)) JSStoragePrototype(globalData, globalObject, structure);
97 ptr->finishCreation(globalData);
101 static const JSC::ClassInfo s_info;
102 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
103 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
104 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
106 return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
110 JSStoragePrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }
112 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
115 class JSStorageConstructor : public DOMConstructorObject {
117 JSStorageConstructor(JSC::Structure*, JSDOMGlobalObject*);
118 void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
121 typedef DOMConstructorObject Base;
122 static JSStorageConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
124 JSStorageConstructor* ptr = new (JSC::allocateCell<JSStorageConstructor>(*exec->heap())) JSStorageConstructor(structure, globalObject);
125 ptr->finishCreation(exec, globalObject);
129 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
130 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
131 static const JSC::ClassInfo s_info;
132 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
134 return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
137 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
142 JSC::EncodedJSValue JSC_HOST_CALL jsStoragePrototypeFunctionKey(JSC::ExecState*);
143 JSC::EncodedJSValue JSC_HOST_CALL jsStoragePrototypeFunctionGetItem(JSC::ExecState*);
144 JSC::EncodedJSValue JSC_HOST_CALL jsStoragePrototypeFunctionSetItem(JSC::ExecState*);
145 JSC::EncodedJSValue JSC_HOST_CALL jsStoragePrototypeFunctionRemoveItem(JSC::ExecState*);
146 JSC::EncodedJSValue JSC_HOST_CALL jsStoragePrototypeFunctionClear(JSC::ExecState*);
149 JSC::JSValue jsStorageLength(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
150 JSC::JSValue jsStorageConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
152 } // namespace WebCore