/* * Copyright (c) 2025, Shannon Booth * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include namespace Web::WebIDL { // https://webidl.spec.whatwg.org/#dictdef-quotaexceedederroroptions struct QuotaExceededErrorOptions { Optional quota; Optional requested; }; // https://webidl.spec.whatwg.org/#quotaexceedederror class WEB_API QuotaExceededError final : public DOMException { WEB_PLATFORM_OBJECT(QuotaExceededError, DOMException); GC_DECLARE_ALLOCATOR(QuotaExceededError); public: static GC::Ref create(JS::Realm&, Utf16String const& message); static GC::Ref create(JS::Realm&); static ExceptionOr> construct_impl(JS::Realm&, Utf16String const& message = {}, QuotaExceededErrorOptions const& options = {}); virtual WebIDL::ExceptionOr serialization_steps(HTML::TransferDataEncoder&, bool for_storage, HTML::SerializationMemory&) override; virtual WebIDL::ExceptionOr deserialization_steps(HTML::TransferDataDecoder&, HTML::DeserializationMemory&) override; // https://webidl.spec.whatwg.org/#dom-quotaexceedederror-quota Optional const& quota() const { return m_quota; } // https://webidl.spec.whatwg.org/#dom-quotaexceedederror-quota Optional const& requested() const { return m_requested; } protected: QuotaExceededError(JS::Realm&, Utf16String const& message); QuotaExceededError(JS::Realm&); virtual void initialize(JS::Realm&) override; private: // https://webidl.spec.whatwg.org/#quotaexceedederror-quota Optional m_quota; // https://webidl.spec.whatwg.org/#quotaexceedederror-requested Optional m_requested; }; }