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

LibWeb/HTML: Port Window.fetch() to IDL

This commit is contained in:
Linus Groh 2023-03-07 18:15:52 +00:00
parent a2fb3a1653
commit 5cc6b1c4db
12 changed files with 22 additions and 389 deletions

View file

@ -10,6 +10,7 @@
#include <AK/Utf8View.h>
#include <AK/Vector.h>
#include <LibTextCodec/Decoder.h>
#include <LibWeb/Fetch/FetchMethod.h>
#include <LibWeb/Forward.h>
#include <LibWeb/HTML/WindowOrWorkerGlobalScope.h>
#include <LibWeb/Infra/Base64.h>
@ -83,4 +84,10 @@ WebIDL::ExceptionOr<String> WindowOrWorkerGlobalScopeMixin::atob(String const& d
return TRY_OR_THROW_OOM(vm, decoder->to_utf8(decoded_data.value()));
}
JS::NonnullGCPtr<JS::Promise> WindowOrWorkerGlobalScopeMixin::fetch(Fetch::RequestInfo const& input, Fetch::RequestInit const& init) const
{
auto& vm = this_impl().vm();
return Fetch::fetch(vm, input, init);
}
}