ladybird/Userland/Libraries/LibWeb/Fetch/Infrastructure
Timothy Flynn 7b3ddd5e15 LibWeb: Track fetching-related tasks in FetchController for cancellation
The HTMLMediaElement, for example, contains spec text which states any
ongoing fetch process must be "stopped". The spec does not indicate how
to do this, so our implementation is rather ad-hoc.

Our current implementation may cause a crash in places that assume one
of the fetch algorithms that we set to null is *not* null. For example:

    if (fetch_params.process_response) {
        queue_fetch_task([]() {
            fetch_params.process_response();
        };
    }

If the fetch process is stopped after queuing the fetch task, but not
before the fetch task is run, we will crash when running this fetch
algorithm.

We now track queued fetch tasks on the fetch controller. When the fetch
process is stopped, we cancel any such pending task.

It is a little bit awkward maintaining a fetch task ID. Ideally, we
could use the underlying task ID throughout. But we do not have access
to the underlying task nor its ID when the task is running, at which
point we need some ID to remove from the pending task list.
2024-03-23 13:45:35 +01:00
..
HTTP AK+LibURL: Move AK::URL into a new URL library 2024-03-18 14:06:28 -04:00
ConnectionTimingInfo.cpp LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
ConnectionTimingInfo.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
FetchAlgorithms.cpp LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
FetchAlgorithms.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
FetchController.cpp LibWeb: Track fetching-related tasks in FetchController for cancellation 2024-03-23 13:45:35 +01:00
FetchController.h LibWeb: Track fetching-related tasks in FetchController for cancellation 2024-03-23 13:45:35 +01:00
FetchParams.cpp LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
FetchParams.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
FetchTimingInfo.cpp LibJS: Convert Heap::allocate{,_without_realm}() to NonnullGCPtr 2022-12-15 06:56:37 -05:00
FetchTimingInfo.h LibWeb/Fetch: Port infrastructure to new String 2023-03-03 09:25:34 +00:00
HTTP.cpp LibWeb/Fetch: Port infrastructure to new String 2023-03-03 09:25:34 +00:00
HTTP.h LibWeb/Fetch: Port infrastructure to new String 2023-03-03 09:25:34 +00:00
MimeTypeBlocking.cpp LibWeb/Fetch: Propagate OOM errors from HeaderList::extract_mime_type() 2023-03-03 11:02:21 +00:00
MimeTypeBlocking.h LibWeb/Fetch: Propagate OOM errors from HeaderList::extract_mime_type() 2023-03-03 11:02:21 +00:00
NoSniffBlocking.cpp LibWeb/Fetch: Propagate OOM errors from HeaderList::extract_mime_type() 2023-03-03 11:02:21 +00:00
NoSniffBlocking.h LibWeb: Implement 'Should response be blocked due to nosniff?' AO 2022-10-30 20:10:29 +00:00
PortBlocking.cpp LibWeb: Implement 'Should request be blocked due to a bad port' AO 2022-10-30 20:10:29 +00:00
PortBlocking.h LibWeb: Implement 'Should request be blocked due to a bad port' AO 2022-10-30 20:10:29 +00:00
RequestOrResponseBlocking.h LibWeb: Implement 'Should request be blocked due to a bad port' AO 2022-10-30 20:10:29 +00:00
Task.cpp LibWeb: Track fetching-related tasks in FetchController for cancellation 2024-03-23 13:45:35 +01:00
Task.h LibWeb: Track fetching-related tasks in FetchController for cancellation 2024-03-23 13:45:35 +01:00
URL.cpp AK+LibURL: Move AK::URL into a new URL library 2024-03-18 14:06:28 -04:00
URL.h AK+LibURL: Move AK::URL into a new URL library 2024-03-18 14:06:28 -04:00