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/. */
7 #ifndef DOM_QUOTA_REMOTEQUOTAOBJECT_H_
8 #define DOM_QUOTA_REMOTEQUOTAOBJECT_H_
10 #include "mozilla/dom/quota/QuotaObject.h"
12 namespace mozilla::dom::quota
{
14 class RemoteQuotaObjectChild
;
16 // This object can only be used on the thread which it was created on
17 class RemoteQuotaObject final
: public QuotaObject
{
19 explicit RemoteQuotaObject(RefPtr
<RemoteQuotaObjectChild
> aActor
);
21 NS_INLINE_DECL_REFCOUNTING_ONEVENTTARGET(RemoteQuotaObject
, override
)
27 const nsAString
& Path() const override
;
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
;
33 bool IncreaseSize(int64_t aDelta
) override
{ return false; }
35 void DisableQuotaCheck() override
{}
37 void EnableQuotaCheck() override
{}
42 RefPtr
<RemoteQuotaObjectChild
> mActor
;
45 } // namespace mozilla::dom::quota
47 #endif // DOM_QUOTA_REMOTEQUOTAOBJECT_H_