1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:58:11 +00:00

LibWeb: Invent a method to stop an in-progress fetch without errors

The HTMLMediaElement will need to stop fetching processes when its load
algorithm is invoked while a fetch is ongoing. We don't have a way to
really stop the process, due to the way it runs on nested deferred task
invocations. So for now, this swaps the fetch callbacks (e.g. to process
a fetch response) with empty callbacks.
This commit is contained in:
Timothy Flynn 2023-04-19 09:15:16 -04:00 committed by Andreas Kling
parent 1fb0c7826b
commit 8d4d01d99a
3 changed files with 26 additions and 0 deletions

View file

@ -17,6 +17,7 @@ FetchParams::FetchParams(JS::NonnullGCPtr<Request> request, JS::NonnullGCPtr<Fet
, m_controller(controller)
, m_timing_info(timing_info)
{
m_controller->set_fetch_params({}, *this);
}
JS::NonnullGCPtr<FetchParams> FetchParams::create(JS::VM& vm, JS::NonnullGCPtr<Request> request, JS::NonnullGCPtr<FetchTimingInfo> timing_info)