LibWeb: Implement BroadcastChannel.postMessage

The repository being in static storage is a bit of a hodgepodge, but in
line with how our current storage partitioning is done. We should
eventually move this, along with other across browsing context APIs to a
proper location at a later stage. But for now, this makes progress on
the meat of the BroadcastChannel API.
This commit is contained in:
Shannon Booth 2024-11-23 20:45:26 +13:00 committed by Andreas Kling
commit e565e3c557
Notes: github-actions[bot] 2024-11-23 15:44:45 +00:00
9 changed files with 422 additions and 2 deletions

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2024, Jamie Mansfield <jmansfield@cadixdev.org>
* Copyright (c) 2024, Shannon Booth <shannon@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -24,6 +25,8 @@ public:
return m_channel_name;
}
WebIDL::ExceptionOr<void> post_message(JS::Value message);
void close();
void set_onmessage(GC::Ptr<WebIDL::CallbackType>);
@ -36,6 +39,8 @@ private:
virtual void initialize(JS::Realm&) override;
bool is_eligible_for_messaging() const;
FlyString m_channel_name;
bool m_closed_flag { false };
};