mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:27:45 +00:00
LibWeb+Browser+Ladybird: Use JS::SafeFunction for EventLoop callbacks
This automatically protects captured objects from being GC'd before the callback runs.
This commit is contained in:
parent
892470a912
commit
6d93e03211
11 changed files with 19 additions and 19 deletions
|
@ -7,6 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Forward.h>
|
||||
#include <LibJS/SafeFunction.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::Platform {
|
||||
|
@ -18,8 +19,8 @@ public:
|
|||
|
||||
virtual ~EventLoopPlugin();
|
||||
|
||||
virtual void spin_until(Function<bool()> goal_condition) = 0;
|
||||
virtual void deferred_invoke(Function<void()>) = 0;
|
||||
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;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue