1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:27:43 +00:00

LibJS+LibWeb: Spin event loop via VM::CustomData abstraction

Instead of calling Core::EventLoop directly, LibJS now has a virtual
function on VM::CustomData for customizing this behavior.

We use this in LibWeb to plumb the spin request through to the
PlatformEventPlugin.
This commit is contained in:
Andreas Kling 2022-09-08 00:13:39 +02:00
parent 9567e211e7
commit 7b0dd98103
4 changed files with 15 additions and 2 deletions

View file

@ -20,6 +20,8 @@ namespace Web::Bindings {
struct WebEngineCustomData final : public JS::VM::CustomData {
virtual ~WebEngineCustomData() override = default;
virtual void spin_event_loop_until(Function<bool()> goal_condition) override;
HTML::EventLoop event_loop;
// FIXME: These should only be on similar-origin window agents, but we don't currently differentiate agent types.