Task.cpp 694 B

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