mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 22:30:31 +00:00
LibWeb: Make EventLoopPlugin::deferred_invoke take a HeapFunction
This commit is contained in:
parent
7487a782db
commit
29cea5bd24
Notes:
github-actions[bot]
2024-10-30 19:57:08 +00:00
Author: https://github.com/shannonbooth
Commit: 29cea5bd24
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2062
Reviewed-by: https://github.com/kalenikaliaksandr ✅
21 changed files with 75 additions and 73 deletions
|
@ -440,7 +440,7 @@ WebIDL::ExceptionOr<JS::GCPtr<PendingResponse>> main_fetch(JS::Realm& realm, Inf
|
|||
}
|
||||
|
||||
// 11. If recursive is false, then run the remaining steps in parallel.
|
||||
Platform::EventLoopPlugin::the().deferred_invoke([&realm, &vm, &fetch_params, request, response, get_response = move(get_response)] {
|
||||
Platform::EventLoopPlugin::the().deferred_invoke(JS::create_heap_function(realm.heap(), [&realm, &vm, &fetch_params, request, response, get_response = move(get_response)] {
|
||||
// 12. If response is null, then set response to the result of running the steps corresponding to the first
|
||||
// matching statement:
|
||||
auto pending_response = PendingResponse::create(vm, request, Infrastructure::Response::create(vm));
|
||||
|
@ -589,7 +589,7 @@ WebIDL::ExceptionOr<JS::GCPtr<PendingResponse>> main_fetch(JS::Realm& realm, Inf
|
|||
fetch_response_handover(realm, fetch_params, *response);
|
||||
}
|
||||
});
|
||||
});
|
||||
}));
|
||||
|
||||
return JS::GCPtr<PendingResponse> {};
|
||||
}
|
||||
|
@ -1920,9 +1920,9 @@ WebIDL::ExceptionOr<JS::NonnullGCPtr<PendingResponse>> http_network_or_cache_fet
|
|||
revalidate_request->set_service_workers_mode(Infrastructure::Request::ServiceWorkersMode::None);
|
||||
|
||||
// 7. In parallel, run main fetch given a new fetch params whose request is revalidateRequest.
|
||||
Platform::EventLoopPlugin::the().deferred_invoke([&vm, &realm, revalidate_request, fetch_params = JS::NonnullGCPtr(fetch_params)] {
|
||||
Platform::EventLoopPlugin::the().deferred_invoke(JS::create_heap_function(realm.heap(), [&vm, &realm, revalidate_request, fetch_params = JS::NonnullGCPtr(fetch_params)] {
|
||||
(void)main_fetch(realm, Infrastructure::FetchParams::create(vm, revalidate_request, fetch_params->timing_info()));
|
||||
});
|
||||
}));
|
||||
}
|
||||
// 2. Otherwise:
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue