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

LibWeb: Implement 'Queue a fetch task' AO

This commit is contained in:
Linus Groh 2022-10-25 19:36:50 +01:00
parent 6deb5ce9b5
commit 14e722617c
3 changed files with 38 additions and 0 deletions

View file

@ -0,0 +1,21 @@
/*
* Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Fetch/Infrastructure/Task.h>
#include <LibWeb/HTML/EventLoop/EventLoop.h>
namespace Web::Fetch::Infrastructure {
// https://fetch.spec.whatwg.org/#queue-a-fetch-task
void queue_fetch_task(JS::Object& task_destination, JS::SafeFunction<void()> algorithm)
{
// FIXME: 1. If taskDestination is a parallel queue, then enqueue algorithm to taskDestination.
// 2. Otherwise, queue a global task on the networking task source with taskDestination and algorithm.
HTML::queue_global_task(HTML::Task::Source::Networking, task_destination, move(algorithm));
}
}