From 95559c427704b00ea3b7adbd7df44f4ba53f50f9 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 19 Sep 2021 22:12:31 +0200 Subject: [PATCH] LibWeb: Implement basic support for MessageChannel and MessagePort This patch adds a basic initial implementation of these API's. Since LibWeb currently doesn't support workers, this implementation of messaging doesn't bother with serializing and deserializing messages. --- Base/res/html/misc/message-channel.html | 7 + Base/res/html/misc/welcome.html | 1 + .../LibWeb/WrapperGenerator.cpp | 2 + .../LibWeb/Bindings/WindowObjectHelper.h | 3 + Userland/Libraries/LibWeb/CMakeLists.txt | 4 + Userland/Libraries/LibWeb/Forward.h | 4 + .../Libraries/LibWeb/HTML/MessageChannel.cpp | 31 +++++ .../Libraries/LibWeb/HTML/MessageChannel.h | 47 +++++++ .../Libraries/LibWeb/HTML/MessageChannel.idl | 8 ++ .../Libraries/LibWeb/HTML/MessagePort.cpp | 126 ++++++++++++++++++ Userland/Libraries/LibWeb/HTML/MessagePort.h | 79 +++++++++++ .../Libraries/LibWeb/HTML/MessagePort.idl | 10 ++ 12 files changed, 322 insertions(+) create mode 100644 Base/res/html/misc/message-channel.html create mode 100644 Userland/Libraries/LibWeb/HTML/MessageChannel.cpp create mode 100644 Userland/Libraries/LibWeb/HTML/MessageChannel.h create mode 100644 Userland/Libraries/LibWeb/HTML/MessageChannel.idl create mode 100644 Userland/Libraries/LibWeb/HTML/MessagePort.cpp create mode 100644 Userland/Libraries/LibWeb/HTML/MessagePort.h create mode 100644 Userland/Libraries/LibWeb/HTML/MessagePort.idl diff --git a/Base/res/html/misc/message-channel.html b/Base/res/html/misc/message-channel.html new file mode 100644 index 0000000000..6ee38fc899 --- /dev/null +++ b/Base/res/html/misc/message-channel.html @@ -0,0 +1,7 @@ + diff --git a/Base/res/html/misc/welcome.html b/Base/res/html/misc/welcome.html index c6f410b2bd..c3abeb56fe 100644 --- a/Base/res/html/misc/welcome.html +++ b/Base/res/html/misc/welcome.html @@ -127,6 +127,7 @@

JavaScript/Wasm