diff options
author | Gunnar Sletta <gunnar@trolltech.com> | 2009-10-26 09:18:38 (GMT) |
---|---|---|
committer | Gunnar Sletta <gunnar@trolltech.com> | 2009-10-26 09:18:38 (GMT) |
commit | 27d4a7e457b1e40e7cd19a179d3d932b1618b4fa (patch) | |
tree | bea1d2f8e821ddf3abd032312b4309c373aa88a4 /src/3rdparty/webkit/WebCore/generated/JSWebSocket.cpp | |
parent | d576d770b9b8251f1b5b4808a84045af33e62dba (diff) | |
parent | 4e55bb8a761cc3e246c539fc5f7cce103ed4d730 (diff) | |
download | Qt-27d4a7e457b1e40e7cd19a179d3d932b1618b4fa.zip Qt-27d4a7e457b1e40e7cd19a179d3d932b1618b4fa.tar.gz Qt-27d4a7e457b1e40e7cd19a179d3d932b1618b4fa.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-graphics-team into 4.6
Diffstat (limited to 'src/3rdparty/webkit/WebCore/generated/JSWebSocket.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebCore/generated/JSWebSocket.cpp | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/src/3rdparty/webkit/WebCore/generated/JSWebSocket.cpp b/src/3rdparty/webkit/WebCore/generated/JSWebSocket.cpp index 44fa960..ea8ff3d 100644 --- a/src/3rdparty/webkit/WebCore/generated/JSWebSocket.cpp +++ b/src/3rdparty/webkit/WebCore/generated/JSWebSocket.cpp @@ -24,9 +24,11 @@ #include "JSWebSocket.h" +#include "Event.h" #include "EventListener.h" #include "Frame.h" #include "JSDOMGlobalObject.h" +#include "JSEvent.h" #include "JSEventListener.h" #include "KURL.h" #include "RegisteredEventListener.h" @@ -64,13 +66,16 @@ static JSC_CONST_HASHTABLE HashTable JSWebSocketTable = /* Hash table for prototype */ -static const HashTableValue JSWebSocketPrototypeTableValues[6] = +static const HashTableValue JSWebSocketPrototypeTableValues[9] = { { "CONNECTING", DontDelete|ReadOnly, (intptr_t)jsWebSocketCONNECTING, (intptr_t)0 }, { "OPEN", DontDelete|ReadOnly, (intptr_t)jsWebSocketOPEN, (intptr_t)0 }, { "CLOSED", DontDelete|ReadOnly, (intptr_t)jsWebSocketCLOSED, (intptr_t)0 }, { "send", DontDelete|Function, (intptr_t)jsWebSocketPrototypeFunctionSend, (intptr_t)1 }, { "close", DontDelete|Function, (intptr_t)jsWebSocketPrototypeFunctionClose, (intptr_t)0 }, + { "addEventListener", DontDelete|Function, (intptr_t)jsWebSocketPrototypeFunctionAddEventListener, (intptr_t)3 }, + { "removeEventListener", DontDelete|Function, (intptr_t)jsWebSocketPrototypeFunctionRemoveEventListener, (intptr_t)3 }, + { "dispatchEvent", DontDelete|Function, (intptr_t)jsWebSocketPrototypeFunctionDispatchEvent, (intptr_t)1 }, { 0, 0, 0, 0 } }; @@ -257,6 +262,40 @@ JSValue JSC_HOST_CALL jsWebSocketPrototypeFunctionClose(ExecState* exec, JSObjec return jsUndefined(); } +JSValue JSC_HOST_CALL jsWebSocketPrototypeFunctionAddEventListener(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) +{ + UNUSED_PARAM(args); + if (!thisValue.inherits(&JSWebSocket::s_info)) + return throwError(exec, TypeError); + JSWebSocket* castedThisObj = static_cast<JSWebSocket*>(asObject(thisValue)); + return castedThisObj->addEventListener(exec, args); +} + +JSValue JSC_HOST_CALL jsWebSocketPrototypeFunctionRemoveEventListener(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) +{ + UNUSED_PARAM(args); + if (!thisValue.inherits(&JSWebSocket::s_info)) + return throwError(exec, TypeError); + JSWebSocket* castedThisObj = static_cast<JSWebSocket*>(asObject(thisValue)); + return castedThisObj->removeEventListener(exec, args); +} + +JSValue JSC_HOST_CALL jsWebSocketPrototypeFunctionDispatchEvent(ExecState* exec, JSObject*, JSValue thisValue, const ArgList& args) +{ + UNUSED_PARAM(args); + if (!thisValue.inherits(&JSWebSocket::s_info)) + return throwError(exec, TypeError); + JSWebSocket* castedThisObj = static_cast<JSWebSocket*>(asObject(thisValue)); + WebSocket* imp = static_cast<WebSocket*>(castedThisObj->impl()); + ExceptionCode ec = 0; + Event* evt = toEvent(args.at(0)); + + + JSC::JSValue result = jsBoolean(imp->dispatchEvent(evt, ec)); + setDOMException(exec, ec); + return result; +} + // Constant getters JSValue jsWebSocketCONNECTING(ExecState* exec, const Identifier&, const PropertySlot&) |