diff options
author | Linus Groh <mail@linusgroh.de> | 2023-03-07 18:15:52 +0000 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-03-07 23:33:34 +0000 |
commit | 5cc6b1c4dbb1fa488c3cffc146c1a0471ecff83e (patch) | |
tree | bfba9e9e9682ff731187a271211ba135e6de50f5 /Userland/Libraries/LibWeb/Fetch | |
parent | a2fb3a1653cd8b963c1840af5f4a0ba981de2708 (diff) | |
download | serenity-5cc6b1c4dbb1fa488c3cffc146c1a0471ecff83e.zip |
LibWeb/HTML: Port Window.fetch() to IDL
Diffstat (limited to 'Userland/Libraries/LibWeb/Fetch')
-rw-r--r-- | Userland/Libraries/LibWeb/Fetch/FetchMethod.cpp | 3 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Fetch/FetchMethod.h | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Fetch/Request.h | 1 | ||||
-rw-r--r-- | Userland/Libraries/LibWeb/Fetch/Response.h | 1 |
4 files changed, 6 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/Fetch/FetchMethod.cpp b/Userland/Libraries/LibWeb/Fetch/FetchMethod.cpp index 1743c9715f..cbad7543b6 100644 --- a/Userland/Libraries/LibWeb/Fetch/FetchMethod.cpp +++ b/Userland/Libraries/LibWeb/Fetch/FetchMethod.cpp @@ -19,12 +19,13 @@ #include <LibWeb/Fetch/Infrastructure/HTTP/Responses.h> #include <LibWeb/Fetch/Request.h> #include <LibWeb/Fetch/Response.h> +#include <LibWeb/WebIDL/ExceptionOr.h> #include <LibWeb/WebIDL/Promise.h> namespace Web::Fetch { // https://fetch.spec.whatwg.org/#dom-global-fetch -JS::NonnullGCPtr<JS::Promise> fetch_impl(JS::VM& vm, RequestInfo const& input, RequestInit const& init) +JS::NonnullGCPtr<JS::Promise> fetch(JS::VM& vm, RequestInfo const& input, RequestInit const& init) { auto& realm = *vm.current_realm(); diff --git a/Userland/Libraries/LibWeb/Fetch/FetchMethod.h b/Userland/Libraries/LibWeb/Fetch/FetchMethod.h index b722850a1c..77b906426c 100644 --- a/Userland/Libraries/LibWeb/Fetch/FetchMethod.h +++ b/Userland/Libraries/LibWeb/Fetch/FetchMethod.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, Linus Groh <linusg@serenityos.org> + * Copyright (c) 2022-2023, Linus Groh <linusg@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ @@ -14,7 +14,7 @@ namespace Web::Fetch { -JS::NonnullGCPtr<JS::Promise> fetch_impl(JS::VM&, RequestInfo const& input, RequestInit const& init = {}); +JS::NonnullGCPtr<JS::Promise> fetch(JS::VM&, RequestInfo const& input, RequestInit const& init = {}); void abort_fetch(JS::Realm&, WebIDL::Promise const&, JS::NonnullGCPtr<Infrastructure::Request>, JS::GCPtr<Response>, JS::Value error); } diff --git a/Userland/Libraries/LibWeb/Fetch/Request.h b/Userland/Libraries/LibWeb/Fetch/Request.h index c794e3d39b..3f54e15906 100644 --- a/Userland/Libraries/LibWeb/Fetch/Request.h +++ b/Userland/Libraries/LibWeb/Fetch/Request.h @@ -10,6 +10,7 @@ #include <LibJS/Forward.h> #include <LibJS/Heap/GCPtr.h> #include <LibWeb/Bindings/PlatformObject.h> +#include <LibWeb/Bindings/RequestPrototype.h> #include <LibWeb/Fetch/Body.h> #include <LibWeb/Fetch/BodyInit.h> #include <LibWeb/Fetch/Headers.h> diff --git a/Userland/Libraries/LibWeb/Fetch/Response.h b/Userland/Libraries/LibWeb/Fetch/Response.h index b78bdf047b..e56045bd2b 100644 --- a/Userland/Libraries/LibWeb/Fetch/Response.h +++ b/Userland/Libraries/LibWeb/Fetch/Response.h @@ -10,6 +10,7 @@ #include <LibJS/Forward.h> #include <LibJS/Heap/GCPtr.h> #include <LibWeb/Bindings/PlatformObject.h> +#include <LibWeb/Bindings/RequestPrototype.h> #include <LibWeb/Fetch/Body.h> #include <LibWeb/Fetch/BodyInit.h> #include <LibWeb/Fetch/Headers.h> |