mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-05 02:33:03 +00:00
LibWeb: Port EventLoop::spin_XXX to HeapFunction
This commit is contained in:
parent
29cea5bd24
commit
1c18b900e2
Notes:
github-actions[bot]
2024-10-30 19:57:02 +00:00
Author: https://github.com/shannonbooth
Commit: 1c18b900e2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2062
Reviewed-by: https://github.com/kalenikaliaksandr ✅
14 changed files with 68 additions and 65 deletions
|
@ -862,7 +862,7 @@ WebIDL::ExceptionOr<void> HTMLMediaElement::select_resource()
|
|||
});
|
||||
|
||||
// 7. Wait for the task queued by the previous step to have executed.
|
||||
HTML::main_thread_event_loop().spin_until([&]() { return ran_media_element_task; });
|
||||
HTML::main_thread_event_loop().spin_until(JS::create_heap_function(heap(), [&]() { return ran_media_element_task; }));
|
||||
};
|
||||
|
||||
// 1. ⌛ If the src attribute's value is the empty string, then end the synchronous section, and jump down to the failed with attribute step below.
|
||||
|
@ -1580,7 +1580,7 @@ void HTMLMediaElement::seek_element(double playback_position, MediaSeekMode seek
|
|||
// available, and, if it is, until it has decoded enough data to play back that position.
|
||||
m_seek_in_progress = true;
|
||||
on_seek(playback_position, seek_mode);
|
||||
HTML::main_thread_event_loop().spin_until([&]() { return !m_seek_in_progress; });
|
||||
HTML::main_thread_event_loop().spin_until(JS::create_heap_function(heap(), [&]() { return !m_seek_in_progress; }));
|
||||
|
||||
// FIXME: 13. Await a stable state. The synchronous section consists of all the remaining steps of this algorithm. (Steps in the
|
||||
// synchronous section are marked with ⌛.)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue