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:
Andrew Kaster 2024-12-09 19:47:09 -07:00 committed by Andreas Kling
parent 31d21570bf
commit 6ed2bf2bb1
Notes: github-actions[bot] 2024-12-10 06:14:10 +00:00
6 changed files with 17 additions and 16 deletions

View file

@ -892,7 +892,7 @@ WebIDL::ExceptionOr<void> XMLHttpRequest::send(Optional<DocumentOrXMLHttpRequest
}
} else {
// 1. Let processedResponse be false.
bool processed_response = false;
IGNORE_USE_IN_ESCAPING_LAMBDA bool processed_response = false;
// 2. Let processResponseConsumeBody, given a response and nullOrFailureOrBytes, be these steps:
auto process_response_consume_body = [this, &processed_response](GC::Ref<Fetch::Infrastructure::Response> response, Variant<Empty, Fetch::Infrastructure::FetchAlgorithms::ConsumeBodyFailureTag, ByteBuffer> null_or_failure_or_bytes) {
@ -927,7 +927,7 @@ WebIDL::ExceptionOr<void> XMLHttpRequest::send(Optional<DocumentOrXMLHttpRequest
// 4. Let now be the present time.
// 5. Pause until either processedResponse is true or thiss timeout is not 0 and thiss timeout milliseconds have passed since now.
bool did_time_out = false;
IGNORE_USE_IN_ESCAPING_LAMBDA bool did_time_out = false;
if (m_timeout != 0) {
auto timer = Platform::Timer::create_single_shot(heap(), m_timeout, nullptr);