Bug 1910848 - Switch PQuotaUsageRequest to non-virtual implementation; r=dom-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D194214
This commit is contained in:
@@ -8,7 +8,6 @@ namespace mozilla {
|
|||||||
namespace dom {
|
namespace dom {
|
||||||
namespace quota {
|
namespace quota {
|
||||||
|
|
||||||
[ChildImpl=virtual, ParentImpl=virtual]
|
|
||||||
protocol PQuotaUsageRequest
|
protocol PQuotaUsageRequest
|
||||||
{
|
{
|
||||||
manager PQuota;
|
manager PQuota;
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
#include "QuotaManager.h"
|
#include "QuotaManager.h"
|
||||||
#include "QuotaRequests.h"
|
#include "QuotaRequests.h"
|
||||||
#include "QuotaResults.h"
|
#include "QuotaResults.h"
|
||||||
#include "QuotaUsageRequestChild.h"
|
|
||||||
|
|
||||||
// Global includes
|
// Global includes
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@@ -34,6 +33,7 @@
|
|||||||
#include "mozilla/Variant.h"
|
#include "mozilla/Variant.h"
|
||||||
#include "mozilla/dom/quota/PQuota.h"
|
#include "mozilla/dom/quota/PQuota.h"
|
||||||
#include "mozilla/dom/quota/PersistenceType.h"
|
#include "mozilla/dom/quota/PersistenceType.h"
|
||||||
|
#include "mozilla/dom/quota/QuotaUsageRequestChild.h"
|
||||||
#include "mozilla/dom/quota/ResultExtensions.h"
|
#include "mozilla/dom/quota/ResultExtensions.h"
|
||||||
#include "mozilla/fallible.h"
|
#include "mozilla/fallible.h"
|
||||||
#include "mozilla/hal_sandbox/PHal.h"
|
#include "mozilla/hal_sandbox/PHal.h"
|
||||||
|
|||||||
@@ -13,13 +13,13 @@
|
|||||||
#include "mozilla/dom/quota/PQuota.h"
|
#include "mozilla/dom/quota/PQuota.h"
|
||||||
#include "mozilla/dom/quota/PQuotaRequestParent.h"
|
#include "mozilla/dom/quota/PQuotaRequestParent.h"
|
||||||
#include "mozilla/dom/quota/PQuotaUsageRequestParent.h"
|
#include "mozilla/dom/quota/PQuotaUsageRequestParent.h"
|
||||||
|
#include "mozilla/dom/quota/QuotaUsageRequestParent.h"
|
||||||
#include "mozilla/dom/quota/ResultExtensions.h"
|
#include "mozilla/dom/quota/ResultExtensions.h"
|
||||||
#include "mozilla/ipc/BackgroundParent.h"
|
#include "mozilla/ipc/BackgroundParent.h"
|
||||||
#include "nsDebug.h"
|
#include "nsDebug.h"
|
||||||
#include "nsError.h"
|
#include "nsError.h"
|
||||||
#include "OriginOperations.h"
|
#include "OriginOperations.h"
|
||||||
#include "QuotaRequestBase.h"
|
#include "QuotaRequestBase.h"
|
||||||
#include "QuotaUsageRequestParent.h"
|
|
||||||
|
|
||||||
// CUF == CRASH_UNLESS_FUZZING
|
// CUF == CRASH_UNLESS_FUZZING
|
||||||
#define QM_CUF_AND_IPC_FAIL(actor) \
|
#define QM_CUF_AND_IPC_FAIL(actor) \
|
||||||
|
|||||||
@@ -8,7 +8,6 @@
|
|||||||
|
|
||||||
// Local includes
|
// Local includes
|
||||||
#include "ActorsChild.h"
|
#include "ActorsChild.h"
|
||||||
#include "QuotaUsageRequestChild.h"
|
|
||||||
|
|
||||||
// Global includes
|
// Global includes
|
||||||
#include "mozilla/ErrorNames.h"
|
#include "mozilla/ErrorNames.h"
|
||||||
@@ -19,6 +18,7 @@
|
|||||||
#include "nsIVariant.h"
|
#include "nsIVariant.h"
|
||||||
#include "nsStringFwd.h"
|
#include "nsStringFwd.h"
|
||||||
#include "nscore.h"
|
#include "nscore.h"
|
||||||
|
#include "mozilla/dom/quota/QuotaUsageRequestChild.h"
|
||||||
|
|
||||||
namespace mozilla {
|
namespace mozilla {
|
||||||
class Runnable;
|
class Runnable;
|
||||||
|
|||||||
@@ -36,6 +36,13 @@ void QuotaUsageRequestChild::AssertIsOnOwningThread() const {
|
|||||||
|
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
|
|
||||||
|
mozilla::ipc::IPCResult QuotaUsageRequestChild::Recv__delete__() {
|
||||||
|
AssertIsOnOwningThread();
|
||||||
|
MOZ_ASSERT(mRequest);
|
||||||
|
|
||||||
|
return IPC_OK();
|
||||||
|
}
|
||||||
|
|
||||||
void QuotaUsageRequestChild::ActorDestroy(ActorDestroyReason aWhy) {
|
void QuotaUsageRequestChild::ActorDestroy(ActorDestroyReason aWhy) {
|
||||||
AssertIsOnOwningThread();
|
AssertIsOnOwningThread();
|
||||||
|
|
||||||
@@ -47,11 +54,4 @@ void QuotaUsageRequestChild::ActorDestroy(ActorDestroyReason aWhy) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mozilla::ipc::IPCResult QuotaUsageRequestChild::Recv__delete__() {
|
|
||||||
AssertIsOnOwningThread();
|
|
||||||
MOZ_ASSERT(mRequest);
|
|
||||||
|
|
||||||
return IPC_OK();
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace mozilla::dom::quota
|
} // namespace mozilla::dom::quota
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ class QuotaUsageRequestChild final : public PQuotaUsageRequestChild {
|
|||||||
|
|
||||||
NS_INLINE_DECL_REFCOUNTING(QuotaUsageRequestChild, override)
|
NS_INLINE_DECL_REFCOUNTING(QuotaUsageRequestChild, override)
|
||||||
|
|
||||||
|
// IPDL methods are only called by IPDL.
|
||||||
|
virtual mozilla::ipc::IPCResult Recv__delete__() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Only created by QuotaManagerService.
|
// Only created by QuotaManagerService.
|
||||||
explicit QuotaUsageRequestChild(UsageRequest* aRequest);
|
explicit QuotaUsageRequestChild(UsageRequest* aRequest);
|
||||||
@@ -40,10 +43,7 @@ class QuotaUsageRequestChild final : public PQuotaUsageRequestChild {
|
|||||||
// Only destroyed by QuotaChild.
|
// Only destroyed by QuotaChild.
|
||||||
~QuotaUsageRequestChild();
|
~QuotaUsageRequestChild();
|
||||||
|
|
||||||
// IPDL methods are only called by IPDL.
|
|
||||||
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
virtual void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||||
|
|
||||||
virtual mozilla::ipc::IPCResult Recv__delete__() override;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace mozilla::dom::quota
|
} // namespace mozilla::dom::quota
|
||||||
|
|||||||
@@ -26,12 +26,6 @@ void QuotaUsageRequestParent::Destroy() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QuotaUsageRequestParent::ActorDestroy(ActorDestroyReason aWhy) {
|
|
||||||
AssertIsOnOwningThread();
|
|
||||||
|
|
||||||
mCancelPromiseHolder.RejectIfExists(NS_ERROR_FAILURE, __func__);
|
|
||||||
}
|
|
||||||
|
|
||||||
mozilla::ipc::IPCResult QuotaUsageRequestParent::RecvCancel() {
|
mozilla::ipc::IPCResult QuotaUsageRequestParent::RecvCancel() {
|
||||||
AssertIsOnOwningThread();
|
AssertIsOnOwningThread();
|
||||||
|
|
||||||
@@ -40,4 +34,10 @@ mozilla::ipc::IPCResult QuotaUsageRequestParent::RecvCancel() {
|
|||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QuotaUsageRequestParent::ActorDestroy(ActorDestroyReason aWhy) {
|
||||||
|
AssertIsOnOwningThread();
|
||||||
|
|
||||||
|
mCancelPromiseHolder.RejectIfExists(NS_ERROR_FAILURE, __func__);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace mozilla::dom::quota
|
} // namespace mozilla::dom::quota
|
||||||
|
|||||||
@@ -24,14 +24,14 @@ class QuotaUsageRequestParent : public BackgroundThreadObject,
|
|||||||
|
|
||||||
void Destroy();
|
void Destroy();
|
||||||
|
|
||||||
|
// IPDL methods.
|
||||||
|
mozilla::ipc::IPCResult RecvCancel();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual ~QuotaUsageRequestParent();
|
virtual ~QuotaUsageRequestParent();
|
||||||
|
|
||||||
// IPDL methods.
|
|
||||||
void ActorDestroy(ActorDestroyReason aWhy) override;
|
void ActorDestroy(ActorDestroyReason aWhy) override;
|
||||||
|
|
||||||
mozilla::ipc::IPCResult RecvCancel() final;
|
|
||||||
|
|
||||||
MozPromiseHolder<BoolPromise> mCancelPromiseHolder;
|
MozPromiseHolder<BoolPromise> mCancelPromiseHolder;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -72,6 +72,8 @@ EXPORTS.mozilla.dom.quota += [
|
|||||||
"QuotaManagerService.h",
|
"QuotaManagerService.h",
|
||||||
"QuotaObject.h",
|
"QuotaObject.h",
|
||||||
"QuotaParent.h",
|
"QuotaParent.h",
|
||||||
|
"QuotaUsageRequestChild.h",
|
||||||
|
"QuotaUsageRequestParent.h",
|
||||||
"RemoteQuotaObjectChild.h",
|
"RemoteQuotaObjectChild.h",
|
||||||
"RemoteQuotaObjectParent.h",
|
"RemoteQuotaObjectParent.h",
|
||||||
"RemoteQuotaObjectParentTracker.h",
|
"RemoteQuotaObjectParentTracker.h",
|
||||||
|
|||||||
Reference in New Issue
Block a user