1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +00:00

LibWeb: Move ExceptionOr from DOM/ to WebIDL/

This is a concept fully defined in the Web IDL spec and doesn't belong
in the DOM directory/namespace - not even DOMException, despite the name
:^)
This commit is contained in:
Linus Groh 2022-09-25 17:03:42 +01:00
parent c0eda77928
commit ad04d7ac9b
107 changed files with 441 additions and 440 deletions

View file

@ -11,8 +11,8 @@
#include <AK/Variant.h>
#include <AK/Vector.h>
#include <LibWeb/Bindings/PlatformObject.h>
#include <LibWeb/DOM/ExceptionOr.h>
#include <LibWeb/Fetch/Infrastructure/HTTP/Headers.h>
#include <LibWeb/WebIDL/ExceptionOr.h>
namespace Web::Fetch {
@ -31,16 +31,16 @@ public:
None,
};
static DOM::ExceptionOr<JS::NonnullGCPtr<Headers>> create_with_global_object(HTML::Window& window, Optional<HeadersInit> const& init);
static WebIDL::ExceptionOr<JS::NonnullGCPtr<Headers>> create_with_global_object(HTML::Window& window, Optional<HeadersInit> const& init);
virtual ~Headers() override;
DOM::ExceptionOr<void> append(Infrastructure::Header);
DOM::ExceptionOr<void> append(String const& name, String const& value);
DOM::ExceptionOr<void> delete_(String const& name);
DOM::ExceptionOr<String> get(String const& name);
DOM::ExceptionOr<bool> has(String const& name);
DOM::ExceptionOr<void> set(String const& name, String const& value);
WebIDL::ExceptionOr<void> append(Infrastructure::Header);
WebIDL::ExceptionOr<void> append(String const& name, String const& value);
WebIDL::ExceptionOr<void> delete_(String const& name);
WebIDL::ExceptionOr<String> get(String const& name);
WebIDL::ExceptionOr<bool> has(String const& name);
WebIDL::ExceptionOr<void> set(String const& name, String const& value);
using ForEachCallback = Function<JS::ThrowCompletionOr<void>(String const&, String const&)>;
JS::ThrowCompletionOr<void> for_each(ForEachCallback);
@ -50,7 +50,7 @@ private:
explicit Headers(HTML::Window&);
DOM::ExceptionOr<void> fill(HeadersInit const&);
WebIDL::ExceptionOr<void> fill(HeadersInit const&);
void remove_privileged_no_cors_headers();
// https://fetch.spec.whatwg.org/#concept-headers-header-list