mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
LibWeb: Use HeapFunction for EventLoopPlugin::spin_until
This commit is contained in:
committed by
Alexander Kalenik
parent
de1a805898
commit
7487a782db
@@ -157,9 +157,9 @@ WebIDL::ExceptionOr<void> FileReader::read_operation(Blob& blob, Type type, Opti
|
||||
|
||||
// 1. Wait for chunkPromise to be fulfilled or rejected.
|
||||
// FIXME: Create spec issue to use WebIDL react to promise steps here instead of this custom logic
|
||||
Platform::EventLoopPlugin::the().spin_until([&]() {
|
||||
Platform::EventLoopPlugin::the().spin_until(JS::create_heap_function(heap(), [promise]() {
|
||||
return promise->state() == JS::Promise::State::Fulfilled || promise->state() == JS::Promise::State::Rejected;
|
||||
});
|
||||
}));
|
||||
|
||||
// 2. If chunkPromise is fulfilled, and isFirstChunk is true, queue a task to fire a progress event called loadstart at fr.
|
||||
// NOTE: ISSUE 2 We might change loadstart to be dispatched synchronously, to align with XMLHttpRequest behavior. [Issue #119]
|
||||
|
||||
Reference in New Issue
Block a user