ladybird/Userland/Libraries/LibWeb/Fetch
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
..
Fetching LibWeb: Track fetching-related tasks in FetchController for cancellation 2024-03-23 13:45:35 +01:00
Infrastructure LibWeb: Track fetching-related tasks in FetchController for cancellation 2024-03-23 13:45:35 +01:00
Body.cpp LibWeb: Add and use a helper to reject a promise with an exception 2024-03-08 14:14:57 -05:00
Body.h LibWeb: Make Fetch::Infrastructure::Body be GC allocated 2023-08-19 15:12:00 +02:00
Body.idl IDL: Add missing #imports 2023-11-11 08:51:51 +01:00
BodyInit.cpp LibWeb: Rename URL platform object to DOMURL 2024-02-25 08:54:31 +01:00
BodyInit.h LibWeb: Rename URL platform object to DOMURL 2024-02-25 08:54:31 +01:00
BodyInit.idl LibWeb: Rename URL platform object to DOMURL 2024-02-25 08:54:31 +01:00
Enums.cpp LibWeb: Consistently use the EmptyString state of ReferrerPolicy 2024-03-06 07:19:10 +01:00
Enums.h LibWeb: Consistently use the EmptyString state of ReferrerPolicy 2024-03-06 07:19:10 +01:00
FetchMethod.cpp LibWeb: Do not use JS::Handle for captures of AbortSignal callbacks 2023-09-26 21:25:54 +02:00
FetchMethod.h LibWeb/HTML: Port Window.fetch() to IDL 2023-03-07 23:33:34 +00:00
Headers.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
Headers.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
Headers.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00
HeadersIterator.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
HeadersIterator.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
Request.cpp AK+LibURL: Move AK::URL into a new URL library 2024-03-18 14:06:28 -04:00
Request.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
Request.idl LibWeb: Switch IDL from UseNewAKString to UseDeprecatedAKString 2023-09-02 19:23:41 +01:00
Response.cpp LibWeb: Avoid FlyString lookups when setting IDL interface prototypes 2024-03-16 16:35:54 +01:00
Response.h LibWeb: Put most LibWeb GC objects in type-specific heap blocks 2023-11-19 22:00:48 +01:00
Response.idl LibWeb: Add comments and missing items of various IDL files 2023-10-25 19:45:41 +02:00