Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: WebCore/bindings/js/JSEventTarget.cpp

Issue 155079: WebSocket implementation in WebKit (Closed)
Patch Set: Rewrite to use SocketStreamHandle Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « WebCore/bindings/js/JSDOMWindowCustom.cpp ('k') | WebCore/bindings/js/JSWebSocketConstructor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/bindings/js/JSEventTarget.cpp
diff --git a/WebCore/bindings/js/JSEventTarget.cpp b/WebCore/bindings/js/JSEventTarget.cpp
index b75cccf6a8178ab559f876e78de41eb35b19d8db..b9373921c5959b3f2bb532893e2d74392601a6ed 100644
--- a/WebCore/bindings/js/JSEventTarget.cpp
+++ b/WebCore/bindings/js/JSEventTarget.cpp
@@ -61,6 +61,11 @@
#include "SharedWorker.h"
#endif
+#if ENABLE(WEB_SOCKETS)
+#include "JSWebSocket.h"
+#include "WebSocket.h"
+#endif
+
using namespace JSC;
namespace WebCore {
@@ -109,6 +114,11 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, EventTarget* targ
return toJS(exec, globalObject, sharedWorker);
#endif
+#if ENABLE(WEB_SOCKETS)
+ if (WebSocket* websocket = target->toWebSocket())
+ return toJS(exec, websocket);
+#endif
+
ASSERT_NOT_REACHED();
return jsNull();
}
@@ -144,6 +154,10 @@ EventTarget* toEventTarget(JSC::JSValue value)
CONVERT_TO_EVENT_TARGET(SharedWorker)
#endif
+#if ENABLE(WEB_SOCKETS)
+ CONVERT_TO_EVENT_TARGET(WebSocket)
+#endif
+
return 0;
}
« no previous file with comments | « WebCore/bindings/js/JSDOMWindowCustom.cpp ('k') | WebCore/bindings/js/JSWebSocketConstructor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698