mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
6d93e03211
This automatically protects captured objects from being GC'd before the callback runs.
29 lines
608 B
C++
29 lines
608 B
C++
/*
|
|
* Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Forward.h>
|
|
#include <LibJS/SafeFunction.h>
|
|
#include <LibWeb/Forward.h>
|
|
|
|
namespace Web::Platform {
|
|
|
|
class EventLoopPlugin {
|
|
public:
|
|
static EventLoopPlugin& the();
|
|
static void install(EventLoopPlugin&);
|
|
|
|
virtual ~EventLoopPlugin();
|
|
|
|
virtual void spin_until(JS::SafeFunction<bool()> goal_condition) = 0;
|
|
virtual void deferred_invoke(JS::SafeFunction<void()>) = 0;
|
|
virtual NonnullRefPtr<Timer> create_timer() = 0;
|
|
virtual void quit() = 0;
|
|
};
|
|
|
|
}
|