2022-09-07 20:30:31 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <AK/Forward.h>
|
2023-04-21 12:13:04 +01:00
|
|
|
#include <LibJS/SafeFunction.h>
|
2022-09-07 20:30:31 +02:00
|
|
|
#include <LibWeb/Forward.h>
|
|
|
|
|
|
|
|
|
|
namespace Web::Platform {
|
|
|
|
|
|
|
|
|
|
class EventLoopPlugin {
|
|
|
|
|
public:
|
|
|
|
|
static EventLoopPlugin& the();
|
|
|
|
|
static void install(EventLoopPlugin&);
|
|
|
|
|
|
|
|
|
|
virtual ~EventLoopPlugin();
|
|
|
|
|
|
2024-05-17 17:09:20 -07:00
|
|
|
virtual void spin_until(JS::SafeFunction<bool()> goal_condition) = 0;
|
2024-05-17 17:14:06 -07:00
|
|
|
virtual void deferred_invoke(ESCAPING JS::SafeFunction<void()>) = 0;
|
2022-09-07 20:30:31 +02:00
|
|
|
virtual NonnullRefPtr<Timer> create_timer() = 0;
|
2022-10-08 10:54:52 +02:00
|
|
|
virtual void quit() = 0;
|
2022-09-07 20:30:31 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|