33
32
class JSWorkerContext : public JSWorkerContextBase {
34
33
typedef JSWorkerContextBase Base;
36
JSWorkerContext(PassRefPtr<JSC::Structure>, PassRefPtr<WorkerContext>);
35
JSWorkerContext(NonNullPassRefPtr<JSC::Structure>, PassRefPtr<WorkerContext>);
36
virtual ~JSWorkerContext();
37
37
virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&);
38
bool customGetOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
39
virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValuePtr, JSC::PutPropertySlot&);
38
virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&);
39
bool getOwnPropertySlotDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
40
bool getOwnPropertyDescriptorDelegate(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
41
virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
40
42
virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
41
43
static const JSC::ClassInfo s_info;
43
static PassRefPtr<JSC::Structure> createStructure(JSC::JSValuePtr prototype)
45
static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
45
47
return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType));
50
virtual void markChildren(JSC::MarkStack&);
51
53
// Custom attributes
52
JSC::JSValuePtr self(JSC::ExecState*) const;
53
void setSelf(JSC::ExecState*, JSC::JSValuePtr);
54
JSC::JSValue messageChannel(JSC::ExecState*) const;
55
JSC::JSValue eventSource(JSC::ExecState*) const;
56
JSC::JSValue xmlHttpRequest(JSC::ExecState*) const;
55
58
// Custom functions
56
JSC::JSValuePtr addEventListener(JSC::ExecState*, const JSC::ArgList&);
57
JSC::JSValuePtr removeEventListener(JSC::ExecState*, const JSC::ArgList&);
59
JSC::JSValue importScripts(JSC::ExecState*, const JSC::ArgList&);
60
JSC::JSValue setTimeout(JSC::ExecState*, const JSC::ArgList&);
61
JSC::JSValue setInterval(JSC::ExecState*, const JSC::ArgList&);
62
JSC::JSValue addEventListener(JSC::ExecState*, const JSC::ArgList&);
63
JSC::JSValue removeEventListener(JSC::ExecState*, const JSC::ArgList&);
61
67
class JSWorkerContextPrototype : public JSC::JSObject {
68
typedef JSC::JSObject Base;
63
70
void* operator new(size_t, JSC::JSGlobalData*);
64
71
virtual const JSC::ClassInfo* classInfo() const { return &s_info; }
65
72
static const JSC::ClassInfo s_info;
66
73
virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&);
67
static PassRefPtr<JSC::Structure> createStructure(JSC::JSValuePtr prototype)
74
virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&);
75
static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype)
69
77
return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType));
71
JSWorkerContextPrototype(PassRefPtr<JSC::Structure> structure) : JSC::JSObject(structure) { }
79
JSWorkerContextPrototype(NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObject(structure) { }
76
JSC::JSValuePtr jsWorkerContextPrototypeFunctionPostMessage(JSC::ExecState*, JSC::JSObject*, JSC::JSValuePtr, const JSC::ArgList&);
77
JSC::JSValuePtr jsWorkerContextPrototypeFunctionAddEventListener(JSC::ExecState*, JSC::JSObject*, JSC::JSValuePtr, const JSC::ArgList&);
78
JSC::JSValuePtr jsWorkerContextPrototypeFunctionRemoveEventListener(JSC::ExecState*, JSC::JSObject*, JSC::JSValuePtr, const JSC::ArgList&);
79
JSC::JSValuePtr jsWorkerContextPrototypeFunctionDispatchEvent(JSC::ExecState*, JSC::JSObject*, JSC::JSValuePtr, const JSC::ArgList&);
84
JSC::JSValue JSC_HOST_CALL jsWorkerContextPrototypeFunctionClose(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
85
JSC::JSValue JSC_HOST_CALL jsWorkerContextPrototypeFunctionImportScripts(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
86
JSC::JSValue JSC_HOST_CALL jsWorkerContextPrototypeFunctionSetTimeout(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
87
JSC::JSValue JSC_HOST_CALL jsWorkerContextPrototypeFunctionClearTimeout(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
88
JSC::JSValue JSC_HOST_CALL jsWorkerContextPrototypeFunctionSetInterval(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
89
JSC::JSValue JSC_HOST_CALL jsWorkerContextPrototypeFunctionClearInterval(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
90
JSC::JSValue JSC_HOST_CALL jsWorkerContextPrototypeFunctionAddEventListener(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
91
JSC::JSValue JSC_HOST_CALL jsWorkerContextPrototypeFunctionRemoveEventListener(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
92
JSC::JSValue JSC_HOST_CALL jsWorkerContextPrototypeFunctionDispatchEvent(JSC::ExecState*, JSC::JSObject*, JSC::JSValue, const JSC::ArgList&);
82
JSC::JSValuePtr jsWorkerContextSelf(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
83
void setJSWorkerContextSelf(JSC::ExecState*, JSC::JSObject*, JSC::JSValuePtr);
84
JSC::JSValuePtr jsWorkerContextOnmessage(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
85
void setJSWorkerContextOnmessage(JSC::ExecState*, JSC::JSObject*, JSC::JSValuePtr);
86
JSC::JSValuePtr jsWorkerContextLocation(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
87
void setJSWorkerContextLocation(JSC::ExecState*, JSC::JSObject*, JSC::JSValuePtr);
88
JSC::JSValuePtr jsWorkerContextNavigator(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
89
void setJSWorkerContextNavigator(JSC::ExecState*, JSC::JSObject*, JSC::JSValuePtr);
90
JSC::JSValuePtr jsWorkerContextMessageEventConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
91
void setJSWorkerContextMessageEventConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValuePtr);
92
JSC::JSValuePtr jsWorkerContextWorkerLocationConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
93
void setJSWorkerContextWorkerLocationConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValuePtr);
95
JSC::JSValue jsWorkerContextSelf(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
96
void setJSWorkerContextSelf(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
97
JSC::JSValue jsWorkerContextLocation(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
98
void setJSWorkerContextLocation(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
99
JSC::JSValue jsWorkerContextOnerror(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
100
void setJSWorkerContextOnerror(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
101
JSC::JSValue jsWorkerContextNavigator(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
102
void setJSWorkerContextNavigator(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
103
JSC::JSValue jsWorkerContextMessageEventConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
104
void setJSWorkerContextMessageEventConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
105
JSC::JSValue jsWorkerContextWorkerLocationConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
106
void setJSWorkerContextWorkerLocationConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
107
JSC::JSValue jsWorkerContextMessageChannelConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
108
void setJSWorkerContextMessageChannelConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
109
JSC::JSValue jsWorkerContextEventSourceConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
110
void setJSWorkerContextEventSourceConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
111
JSC::JSValue jsWorkerContextXMLHttpRequestConstructor(JSC::ExecState*, const JSC::Identifier&, const JSC::PropertySlot&);
112
void setJSWorkerContextXMLHttpRequestConstructor(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
95
114
} // namespace WebCore