1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23: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

@ -34,6 +34,8 @@ class VM : public RefCounted<VM> {
public:
struct CustomData {
virtual ~CustomData() = default;
virtual void spin_event_loop_until(Function<bool()> goal_condition) = 0;
};
static NonnullRefPtr<VM> create(OwnPtr<CustomData> = {});