|
@@ -11,7 +11,7 @@
|
|
|
namespace Web::Fetch::Infrastructure {
|
|
|
|
|
|
// https://fetch.spec.whatwg.org/#queue-a-fetch-task
|
|
|
-int queue_fetch_task(JS::Object& task_destination, JS::NonnullGCPtr<JS::HeapFunction<void()>> algorithm)
|
|
|
+HTML::TaskID queue_fetch_task(JS::Object& task_destination, JS::NonnullGCPtr<JS::HeapFunction<void()>> algorithm)
|
|
|
{
|
|
|
// FIXME: 1. If taskDestination is a parallel queue, then enqueue algorithm to taskDestination.
|
|
|
|
|
@@ -21,18 +21,18 @@ int queue_fetch_task(JS::Object& task_destination, JS::NonnullGCPtr<JS::HeapFunc
|
|
|
|
|
|
// AD-HOC: This overload allows tracking the queued task within the fetch controller so that we may cancel queued tasks
|
|
|
// when the spec indicates that we must stop an ongoing fetch.
|
|
|
-int queue_fetch_task(JS::NonnullGCPtr<FetchController> fetch_controller, JS::Object& task_destination, JS::NonnullGCPtr<JS::HeapFunction<void()>> algorithm)
|
|
|
+HTML::TaskID queue_fetch_task(JS::NonnullGCPtr<FetchController> fetch_controller, JS::Object& task_destination, JS::NonnullGCPtr<JS::HeapFunction<void()>> algorithm)
|
|
|
{
|
|
|
auto fetch_task_id = fetch_controller->next_fetch_task_id();
|
|
|
|
|
|
auto& heap = task_destination.heap();
|
|
|
- int event_id = queue_fetch_task(task_destination, JS::create_heap_function(heap, [fetch_controller, fetch_task_id, algorithm]() {
|
|
|
+ auto html_task_id = queue_fetch_task(task_destination, JS::create_heap_function(heap, [fetch_controller, fetch_task_id, algorithm]() {
|
|
|
fetch_controller->fetch_task_complete(fetch_task_id);
|
|
|
algorithm->function()();
|
|
|
}));
|
|
|
|
|
|
- fetch_controller->fetch_task_queued(fetch_task_id, event_id);
|
|
|
- return event_id;
|
|
|
+ fetch_controller->fetch_task_queued(fetch_task_id, html_task_id);
|
|
|
+ return html_task_id;
|
|
|
}
|
|
|
|
|
|
}
|