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 #include "RemoteQuotaObject.h"
9 #include "mozilla/dom/quota/RemoteQuotaObjectChild.h"
10 #include "mozilla/ipc/BackgroundParent.h"
12 namespace mozilla::dom::quota
{
14 RemoteQuotaObject::RemoteQuotaObject(RefPtr
<RemoteQuotaObjectChild
> aActor
)
15 : QuotaObject(/* aIsRemote */ true), mActor(std::move(aActor
)) {
16 MOZ_COUNT_CTOR(RemoteQuotaObject
);
18 mActor
->SetRemoteQuotaObject(this);
21 RemoteQuotaObject::~RemoteQuotaObject() {
22 MOZ_COUNT_DTOR(RemoteQuotaObject
);
27 void RemoteQuotaObject::ClearActor() {
33 void RemoteQuotaObject::Close() {
38 MOZ_ASSERT(mActor
->GetActorEventTarget()->IsOnCurrentThread());
44 const nsAString
& RemoteQuotaObject::Path() const { return EmptyString(); }
46 bool RemoteQuotaObject::MaybeUpdateSize(int64_t aSize
, bool aTruncate
) {
47 MOZ_ASSERT(!NS_IsMainThread());
48 MOZ_ASSERT(!mozilla::ipc::IsOnBackgroundThread());
49 MOZ_ASSERT(!GetCurrentThreadWorkerPrivate());
55 MOZ_ASSERT(mActor
->GetActorEventTarget()->IsOnCurrentThread());
58 if (!mActor
->SendMaybeUpdateSize(aSize
, aTruncate
, &result
)) {
65 } // namespace mozilla::dom::quota