mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibWeb: Use HeapFunction for EventLoopPlugin::spin_until
This commit is contained in:
parent
de1a805898
commit
7487a782db
Notes:
github-actions[bot]
2024-10-30 19:57:14 +00:00
Author: https://github.com/shannonbooth
Commit: 7487a782db
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2062
Reviewed-by: https://github.com/kalenikaliaksandr ✅
15 changed files with 29 additions and 26 deletions
|
@ -14,9 +14,11 @@ namespace Web::Platform {
|
|||
EventLoopPluginSerenity::EventLoopPluginSerenity() = default;
|
||||
EventLoopPluginSerenity::~EventLoopPluginSerenity() = default;
|
||||
|
||||
void EventLoopPluginSerenity::spin_until(JS::SafeFunction<bool()> goal_condition)
|
||||
void EventLoopPluginSerenity::spin_until(JS::Handle<JS::HeapFunction<bool()>> goal_condition)
|
||||
{
|
||||
Core::EventLoop::current().spin_until(move(goal_condition));
|
||||
Core::EventLoop::current().spin_until([goal_condition = move(goal_condition)]() {
|
||||
return goal_condition->function()();
|
||||
});
|
||||
}
|
||||
|
||||
void EventLoopPluginSerenity::deferred_invoke(JS::SafeFunction<void()> function)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue