ladybird/Userland/Libraries/LibWeb/Fetch/Fetching
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
..
Checks.cpp LibWeb: Rename URL platform object to DOMURL 2024-02-25 08:54:31 +01:00
Checks.h
Fetching.cpp LibWeb: Track fetching-related tasks in FetchController for cancellation 2024-03-23 13:45:35 +01:00
Fetching.h LibWeb/Fetch: Pass recursive=false to manual navigation redirect 2023-04-24 13:38:37 +01:00
PendingResponse.cpp LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
PendingResponse.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
RefCountedFlag.cpp LibWeb: Implement most of the 'Fetching' AOs 2022-10-30 20:10:29 +00:00
RefCountedFlag.h LibWeb: Implement most of the 'Fetching' AOs 2022-10-30 20:10:29 +00:00