mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-27 21:42:53 +00:00
LibWeb: Let queue_global_task() take a JS::HeapFunction
Changes the signature of queue_global_task() from AK:Function to JS::HeapFunction to be more clear to the user of the function that this is what it uses internally.
This commit is contained in:
parent
9540af6489
commit
a3661fd7f2
Notes:
sideshowbarker
2024-07-17 03:05:16 +09:00
Author: https://github.com/kennethmyhra
Commit: a3661fd7f2
Pull-request: https://github.com/SerenityOS/serenity/pull/24026
23 changed files with 104 additions and 103 deletions
|
@ -135,10 +135,10 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<AbortSignal>> AbortSignal::timeout(JS::VM&
|
|||
// 3. Run steps after a timeout given global, "AbortSignal-timeout", milliseconds, and the following step:
|
||||
window_or_worker->run_steps_after_a_timeout(milliseconds, [&realm, &global, signal]() {
|
||||
// 1. Queue a global task on the timer task source given global to signal abort given signal and a new "TimeoutError" DOMException.
|
||||
HTML::queue_global_task(HTML::Task::Source::TimerTask, global, [&realm, signal]() mutable {
|
||||
HTML::queue_global_task(HTML::Task::Source::TimerTask, global, JS::create_heap_function(realm.heap(), [&realm, signal]() mutable {
|
||||
auto reason = WebIDL::TimeoutError::create(realm, "Signal timed out"_fly_string);
|
||||
signal->signal_abort(reason);
|
||||
});
|
||||
}));
|
||||
});
|
||||
|
||||
// 4. Return signal.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue