RemoteQuotaObject.h (1385B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 5 * You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef DOM_QUOTA_REMOTEQUOTAOBJECT_H_ 8 #define DOM_QUOTA_REMOTEQUOTAOBJECT_H_ 9 10 #include "mozilla/dom/quota/QuotaObject.h" 11 12 namespace mozilla::dom::quota { 13 14 class RemoteQuotaObjectChild; 15 16 // This object can only be used on the thread which it was created on 17 class RemoteQuotaObject final : public QuotaObject { 18 public: 19 explicit RemoteQuotaObject(RefPtr<RemoteQuotaObjectChild> aActor); 20 21 NS_INLINE_DECL_REFCOUNTING_ONEVENTTARGET(RemoteQuotaObject, override) 22 23 void ClearActor(); 24 25 void Close(); 26 27 const nsAString& Path() const override; 28 29 // This method should never be called on the main thread or the PBackground 30 // thread or a DOM worker thread (It does sync IPC). 31 [[nodiscard]] bool MaybeUpdateSize(int64_t aSize, bool aTruncate) override; 32 33 bool IncreaseSize(int64_t aDelta) override { return false; } 34 35 void DisableQuotaCheck() override {} 36 37 void EnableQuotaCheck() override {} 38 39 private: 40 ~RemoteQuotaObject(); 41 42 RefPtr<RemoteQuotaObjectChild> mActor; 43 }; 44 45 } // namespace mozilla::dom::quota 46 47 #endif // DOM_QUOTA_REMOTEQUOTAOBJECT_H_