|
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 #ifndef JSWebSocket_h |
|
22 #define JSWebSocket_h |
|
23 |
|
24 #if ENABLE(WEB_SOCKETS) |
|
25 |
|
26 #include "JSDOMBinding.h" |
|
27 #include <runtime/JSGlobalObject.h> |
|
28 #include <runtime/JSObjectWithGlobalObject.h> |
|
29 #include <runtime/ObjectPrototype.h> |
|
30 |
|
31 namespace WebCore { |
|
32 |
|
33 class WebSocket; |
|
34 |
|
35 class JSWebSocket : public DOMObjectWithGlobalPointer { |
|
36 typedef DOMObjectWithGlobalPointer Base; |
|
37 public: |
|
38 JSWebSocket(NonNullPassRefPtr<JSC::Structure>, JSDOMGlobalObject*, PassRefPtr<WebSocket>); |
|
39 virtual ~JSWebSocket(); |
|
40 static JSC::JSObject* createPrototype(JSC::ExecState*, JSC::JSGlobalObject*); |
|
41 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertySlot&); |
|
42 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::PropertyDescriptor&); |
|
43 virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&); |
|
44 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
45 static const JSC::ClassInfo s_info; |
|
46 |
|
47 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
48 { |
|
49 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
50 } |
|
51 |
|
52 virtual void markChildren(JSC::MarkStack&); |
|
53 |
|
54 static JSC::JSValue getConstructor(JSC::ExecState*, JSC::JSGlobalObject*); |
|
55 WebSocket* impl() const { return m_impl.get(); } |
|
56 |
|
57 private: |
|
58 RefPtr<WebSocket> m_impl; |
|
59 protected: |
|
60 static const unsigned StructureFlags = JSC::OverridesMarkChildren | JSC::OverridesGetOwnPropertySlot | Base::StructureFlags; |
|
61 }; |
|
62 |
|
63 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, WebSocket*); |
|
64 WebSocket* toWebSocket(JSC::JSValue); |
|
65 |
|
66 class JSWebSocketPrototype : public JSC::JSObjectWithGlobalObject { |
|
67 typedef JSC::JSObjectWithGlobalObject Base; |
|
68 public: |
|
69 static JSC::JSObject* self(JSC::ExecState*, JSC::JSGlobalObject*); |
|
70 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
71 static const JSC::ClassInfo s_info; |
|
72 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
73 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
74 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
75 { |
|
76 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
77 } |
|
78 JSWebSocketPrototype(JSC::JSGlobalObject* globalObject, NonNullPassRefPtr<JSC::Structure> structure) : JSC::JSObjectWithGlobalObject(globalObject, structure) { } |
|
79 protected: |
|
80 static const unsigned StructureFlags = JSC::OverridesMarkChildren | JSC::OverridesGetOwnPropertySlot | Base::StructureFlags; |
|
81 }; |
|
82 |
|
83 class JSWebSocketConstructor : public DOMConstructorObject { |
|
84 public: |
|
85 JSWebSocketConstructor(JSC::ExecState*, JSDOMGlobalObject*); |
|
86 |
|
87 virtual bool getOwnPropertySlot(JSC::ExecState*, const JSC::Identifier&, JSC::PropertySlot&); |
|
88 virtual bool getOwnPropertyDescriptor(JSC::ExecState*, const JSC::Identifier&, JSC::PropertyDescriptor&); |
|
89 virtual const JSC::ClassInfo* classInfo() const { return &s_info; } |
|
90 static const JSC::ClassInfo s_info; |
|
91 static PassRefPtr<JSC::Structure> createStructure(JSC::JSValue prototype) |
|
92 { |
|
93 return JSC::Structure::create(prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), AnonymousSlotCount); |
|
94 } |
|
95 protected: |
|
96 static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | JSC::ImplementsHasInstance | DOMConstructorObject::StructureFlags; |
|
97 static JSC::EncodedJSValue JSC_HOST_CALL constructJSWebSocket(JSC::ExecState*); |
|
98 virtual JSC::ConstructType getConstructData(JSC::ConstructData&); |
|
99 }; |
|
100 |
|
101 // Functions |
|
102 |
|
103 JSC::EncodedJSValue JSC_HOST_CALL jsWebSocketPrototypeFunctionSend(JSC::ExecState*); |
|
104 JSC::EncodedJSValue JSC_HOST_CALL jsWebSocketPrototypeFunctionClose(JSC::ExecState*); |
|
105 JSC::EncodedJSValue JSC_HOST_CALL jsWebSocketPrototypeFunctionAddEventListener(JSC::ExecState*); |
|
106 JSC::EncodedJSValue JSC_HOST_CALL jsWebSocketPrototypeFunctionRemoveEventListener(JSC::ExecState*); |
|
107 JSC::EncodedJSValue JSC_HOST_CALL jsWebSocketPrototypeFunctionDispatchEvent(JSC::ExecState*); |
|
108 // Attributes |
|
109 |
|
110 JSC::JSValue jsWebSocketURL(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); |
|
111 JSC::JSValue jsWebSocketReadyState(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); |
|
112 JSC::JSValue jsWebSocketBufferedAmount(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); |
|
113 JSC::JSValue jsWebSocketOnopen(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); |
|
114 void setJSWebSocketOnopen(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); |
|
115 JSC::JSValue jsWebSocketOnmessage(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); |
|
116 void setJSWebSocketOnmessage(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); |
|
117 JSC::JSValue jsWebSocketOnerror(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); |
|
118 void setJSWebSocketOnerror(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); |
|
119 JSC::JSValue jsWebSocketOnclose(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); |
|
120 void setJSWebSocketOnclose(JSC::ExecState*, JSC::JSObject*, JSC::JSValue); |
|
121 JSC::JSValue jsWebSocketConstructor(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); |
|
122 // Constants |
|
123 |
|
124 JSC::JSValue jsWebSocketCONNECTING(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); |
|
125 JSC::JSValue jsWebSocketOPEN(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); |
|
126 JSC::JSValue jsWebSocketCLOSED(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&); |
|
127 |
|
128 } // namespace WebCore |
|
129 |
|
130 #endif // ENABLE(WEB_SOCKETS) |
|
131 |
|
132 #endif |