diff options
author | 2022-06-17 04:26:44 -0700 | |
---|---|---|
committer | 2022-06-22 06:56:47 -0700 | |
commit | 38cc869104584987d0a7f3b21be4da196bb3f390 (patch) | |
tree | 6523c2d1d90a80f704e955af335a44d8e89b80f9 /src/javascript/jsc/bindings/ScriptExecutionContext.h | |
parent | 5d8a99e1d4009cb4b9c7766b2af76c3df8364670 (diff) | |
download | bun-38cc869104584987d0a7f3b21be4da196bb3f390.tar.gz bun-38cc869104584987d0a7f3b21be4da196bb3f390.tar.zst bun-38cc869104584987d0a7f3b21be4da196bb3f390.zip |
WIP WebSocket
Diffstat (limited to 'src/javascript/jsc/bindings/ScriptExecutionContext.h')
-rw-r--r-- | src/javascript/jsc/bindings/ScriptExecutionContext.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/javascript/jsc/bindings/ScriptExecutionContext.h b/src/javascript/jsc/bindings/ScriptExecutionContext.h index 4265ffccd..8f4e2edfd 100644 --- a/src/javascript/jsc/bindings/ScriptExecutionContext.h +++ b/src/javascript/jsc/bindings/ScriptExecutionContext.h @@ -10,6 +10,10 @@ #include <wtf/text/WTFString.h> #include "CachedScript.h" #include "wtf/URL.h" +#include <uws/src/WebSocketContext.h> +struct us_socket_t; +struct us_socket_context_t; + namespace WebCore { class ScriptExecutionContext : public CanMakeWeakPtr<ScriptExecutionContext> { @@ -58,6 +62,13 @@ public: { return m_globalObject; } + + template<bool isSSL> + us_socket_context_t* webSocketContext(); + + template<bool isSSL, bool isServer> + uWS::WebSocketContext<isSSL, isServer, ScriptExecutionContext*>* connnectedWebSocketContext(); + const WTF::URL& url() const { return m_url; } bool activeDOMObjectsAreSuspended() { return false; } bool activeDOMObjectsAreStopped() { return false; } @@ -72,7 +83,7 @@ public: // { // } - void postTask(Task&&) + void postTask(Task&& task) { } // Executes the task on context's thread asynchronously. @@ -91,5 +102,11 @@ private: JSC::VM* m_vm = nullptr; JSC::JSGlobalObject* m_globalObject = nullptr; WTF::URL m_url = WTF::URL(); + + us_socket_context_t* m_ssl_client_websockets_ctx = nullptr; + us_socket_context_t* m_client_websockets_ctx = nullptr; + + uWS::WebSocketContext<true, false, ScriptExecutionContext*>* m_ssl_client_websockets_ctx = nullptr; + uWS::WebSocketContext<true, true, ScriptExecutionContext*>* m_client_websockets_ctx = nullptr; }; }
\ No newline at end of file |