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.
26 #include "JSAbstractWorker.h"
27 #include "JSDOMBinding.h"
29 #include <runtime/JSObject.h>
33 class JSWorker : public JSAbstractWorker {
35 typedef JSAbstractWorker Base;
36 static JSWorker* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, PassRefPtr<Worker> impl)
38 JSWorker* ptr = new (JSC::allocateCell<JSWorker>(globalObject->globalData().heap)) JSWorker(structure, globalObject, impl);
39 ptr->finishCreation(globalObject->globalData());
43 static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*);
44 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
45 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
46 static void put(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier& propertyName, 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 JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*);
57 JSC::JSValue postMessage(JSC::ExecState*);
58 JSC::JSValue webkitPostMessage(JSC::ExecState*);
61 return static_cast<Worker*>(Base::impl());
64 JSWorker(JSC::Structure*, JSDOMGlobalObject*, PassRefPtr<Worker>);
65 void finishCreation(JSC::JSGlobalData&);
66 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
69 class JSWorkerOwner : public JSC::WeakHandleOwner {
70 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
71 virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
74 inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, Worker*)
76 DEFINE_STATIC_LOCAL(JSWorkerOwner, jsWorkerOwner, ());
77 return &jsWorkerOwner;
80 inline void* wrapperContext(DOMWrapperWorld* world, Worker*)
85 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, Worker*);
86 Worker* toWorker(JSC::JSValue);
88 class JSWorkerPrototype : public JSC::JSNonFinalObject {
90 typedef JSC::JSNonFinalObject Base;
91 static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*);
92 static JSWorkerPrototype* create(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
94 JSWorkerPrototype* ptr = new (JSC::allocateCell<JSWorkerPrototype>(globalData.heap)) JSWorkerPrototype(globalData, globalObject, structure);
95 ptr->finishCreation(globalData);
99 static const JSC::ClassInfo s_info;
100 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
101 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
102 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
104 return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
108 JSWorkerPrototype(JSC::JSGlobalData& globalData, JSC::JSGlobalObject*, JSC::Structure* structure) : JSC::JSNonFinalObject(globalData, structure) { }
110 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
113 class JSWorkerConstructor : public DOMConstructorObject {
115 JSWorkerConstructor(JSC::Structure*, JSDOMGlobalObject*);
116 void finishCreation(JSC::ExecState*, JSDOMGlobalObject*);
119 typedef DOMConstructorObject Base;
120 static JSWorkerConstructor* create(JSC::ExecState* exec, JSC::Structure* structure, JSDOMGlobalObject* globalObject)
122 JSWorkerConstructor* ptr = new (JSC::allocateCell<JSWorkerConstructor>(*exec->heap())) JSWorkerConstructor(structure, globalObject);
123 ptr->finishCreation(exec, globalObject);
127 static bool getOwnPropertySlot(JSC::JSCell*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
128 static bool getOwnPropertyDescriptor(JSC::JSObject*, JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
129 static const JSC::ClassInfo s_info;
130 static JSC::Structure* createStructure(JSC::JSGlobalData& globalData, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
132 return JSC::Structure::create(globalData, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), &s_info);
135 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags;
136 static JSC::EncodedJSValue JSC_HOST_CALL constructJSWorker(JSC::ExecState*);
137 static JSC::ConstructType getConstructData(JSC::JSCell*, JSC::ConstructData&);
142 JSC::EncodedJSValue JSC_HOST_CALL jsWorkerPrototypeFunctionPostMessage(JSC::ExecState*);
143 JSC::EncodedJSValue JSC_HOST_CALL jsWorkerPrototypeFunctionWebkitPostMessage(JSC::ExecState*);
144 JSC::EncodedJSValue JSC_HOST_CALL jsWorkerPrototypeFunctionTerminate(JSC::ExecState*);
147 JSC::JSValue jsWorkerOnmessage(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
148 void setJSWorkerOnmessage(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
149 JSC::JSValue jsWorkerConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
151 } // namespace WebCore
153 #endif // ENABLE(WORKERS)