/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #ifndef DOM_BASE_QUOTAEXCEEDEDERROR_H_ #define DOM_BASE_QUOTAEXCEEDEDERROR_H_ #include "mozilla/dom/DOMException.h" #include "mozilla/dom/Nullable.h" namespace mozilla::dom { struct QuotaExceededErrorOptions; class QuotaExceededError final : public DOMException { public: QuotaExceededError(nsresult aRv, const nsACString& aMessage, const Nullable& aQuota = Nullable(), const Nullable& aRequested = Nullable(), nsIStackFrame* aLocation = nullptr); JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; static already_AddRefed Constructor( const GlobalObject& aGlobal, const nsAString& aMessage, const QuotaExceededErrorOptions& aOptions, ErrorResult& aRv); Nullable GetQuota() const { return mQuota; } Nullable GetRequested() const { return mRequested; } static already_AddRefed ReadStructuredClone( JSContext* aCx, nsIGlobalObject* aGlobal, JSStructuredCloneReader* aReader); bool WriteStructuredClone(JSContext* aCx, JSStructuredCloneWriter* aWriter) const; private: ~QuotaExceededError() = default; Nullable mQuota; Nullable mRequested; }; } // namespace mozilla::dom #endif // DOM_BASE_QUOTAEXCEEDEDERROR_H_