mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28:49 +00:00
LibWeb: Mark local variables captured in GC functions as ignored
These variables are all captured in queued events or other event loop tasks, but are all guarded by event loop spins later in the function. The IGNORE_USE_IN_ESCAPING_LAMBDA will soon be required for all locals that are captured by ref in GC::Function as well as AK::Function.
This commit is contained in:
parent
31d21570bf
commit
6ed2bf2bb1
Notes:
github-actions[bot]
2024-12-10 06:14:10 +00:00
Author: https://github.com/ADKaster
Commit: 6ed2bf2bb1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2860
6 changed files with 17 additions and 16 deletions
|
@ -475,7 +475,7 @@ WebIDL::ExceptionOr<GC::Ref<ClassicScript>> fetch_a_classic_worker_imported_scri
|
|||
auto& vm = realm.vm();
|
||||
|
||||
// 1. Let response be null.
|
||||
GC::Ptr<Fetch::Infrastructure::Response> response = nullptr;
|
||||
IGNORE_USE_IN_ESCAPING_LAMBDA GC::Ptr<Fetch::Infrastructure::Response> response = nullptr;
|
||||
|
||||
// 2. Let bodyBytes be null.
|
||||
Fetch::Infrastructure::FetchAlgorithms::BodyBytes body_bytes;
|
||||
|
@ -510,6 +510,7 @@ WebIDL::ExceptionOr<GC::Ref<ClassicScript>> fetch_a_classic_worker_imported_scri
|
|||
}
|
||||
|
||||
// 5. Pause until response is not null.
|
||||
// FIXME: Consider using a "response holder" to avoid needing to annotate response as IGNORE_USE_IN_ESCAPING_LAMBDA.
|
||||
auto& event_loop = settings_object.responsible_event_loop();
|
||||
event_loop.spin_until(GC::create_function(vm.heap(), [&]() -> bool {
|
||||
return response;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue