mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-08 04:02:52 +00:00
...and use HeapFunction instead of SafeFunction for task steps. Since there is only one EventLoop per process, it lives as a global handle in the VM custom data. This makes it much easier to reason about lifetimes of tasks, task steps, and random stuff captured by them.
23 lines
553 B
C++
23 lines
553 B
C++
/*
|
|
* Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Variant.h>
|
|
#include <LibJS/Forward.h>
|
|
#include <LibJS/Heap/GCPtr.h>
|
|
#include <LibJS/SafeFunction.h>
|
|
#include <LibWeb/Forward.h>
|
|
|
|
namespace Web::Fetch::Infrastructure {
|
|
|
|
// FIXME: 'or a parallel queue'
|
|
using TaskDestination = Variant<Empty, JS::NonnullGCPtr<JS::Object>>;
|
|
|
|
int queue_fetch_task(JS::Object&, Function<void()>);
|
|
int queue_fetch_task(JS::NonnullGCPtr<FetchController>, JS::Object&, Function<void()>);
|
|
|
|
}
|