mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 02:05:07 +02: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:
Notes:
sideshowbarker
2024-07-17 02:57:43 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/6d93e03211 Pull-request: https://github.com/SerenityOS/serenity/pull/18441 Reviewed-by: https://github.com/linusg Reviewed-by: https://github.com/nico Reviewed-by: https://github.com/trflynn89
@@ -37,7 +37,7 @@ public:
|
||||
TaskQueue& microtask_queue() { return m_microtask_queue; }
|
||||
TaskQueue const& microtask_queue() const { return m_microtask_queue; }
|
||||
|
||||
void spin_until(Function<bool()> goal_condition);
|
||||
void spin_until(JS::SafeFunction<bool()> goal_condition);
|
||||
void process();
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/browsing-the-web.html#termination-nesting-level
|
||||
|
||||
Reference in New Issue
Block a user