diff --git a/dom/quota/OriginOperationBase.cpp b/dom/quota/OriginOperationBase.cpp index 65049b58891e..5683a6937271 100644 --- a/dom/quota/OriginOperationBase.cpp +++ b/dom/quota/OriginOperationBase.cpp @@ -116,10 +116,6 @@ nsresult OriginOperationBase::DirectoryWork() { QuotaManager* const quotaManager = QuotaManager::Get(); QM_TRY(OkIf(quotaManager), NS_ERROR_FAILURE); - if (mNeedsStorageInit) { - QM_TRY(MOZ_TO_RESULT(quotaManager->EnsureStorageIsInitialized())); - } - QM_TRY(MOZ_TO_RESULT(DoDirectoryWork(*quotaManager))); // Must set mState before dispatching otherwise we will race with the owning diff --git a/dom/quota/OriginOperationBase.h b/dom/quota/OriginOperationBase.h index 3642de20561b..0ffdef843e57 100644 --- a/dom/quota/OriginOperationBase.h +++ b/dom/quota/OriginOperationBase.h @@ -45,9 +45,6 @@ class OriginOperationBase : public BackgroundThreadObject, public Runnable { State mState; bool mActorDestroyed; - protected: - bool mNeedsStorageInit; - public: void NoteActorDestroyed() { AssertIsOnOwningThread(); @@ -77,8 +74,7 @@ class OriginOperationBase : public BackgroundThreadObject, public Runnable { Runnable(aRunnableName), mResultCode(NS_OK), mState(State_Initial), - mActorDestroyed(false), - mNeedsStorageInit(false) {} + mActorDestroyed(false) {} // Reference counted. virtual ~OriginOperationBase() { diff --git a/dom/quota/OriginOperations.cpp b/dom/quota/OriginOperations.cpp index 3a9c354d5672..7556cd3f10ba 100644 --- a/dom/quota/OriginOperations.cpp +++ b/dom/quota/OriginOperations.cpp @@ -935,9 +935,6 @@ GetOriginUsageOp::GetOriginUsageOp(const UsageRequestParams& aParams) AssertIsOnOwningThread(); MOZ_ASSERT(aParams.type() == UsageRequestParams::TOriginUsageParams); - // Overwrite OriginOperationBase default values. - mNeedsStorageInit = true; - // Overwrite GetOriginUsageOp default values. mFromMemory = mParams.fromMemory(); } @@ -1031,9 +1028,6 @@ void GetOriginUsageOp::GetResponse(UsageRequestResponse& aResponse) { StorageNameOp::StorageNameOp() : QuotaRequestBase("dom::quota::StorageNameOp", /* aExclusive */ false) { AssertIsOnOwningThread(); - - // Overwrite OriginOperationBase default values. - mNeedsStorageInit = false; } RefPtr StorageNameOp::CreateDirectoryLock() { return nullptr; } @@ -1062,9 +1056,6 @@ InitializedRequestBase::InitializedRequestBase(const char* aRunnableName) : QuotaRequestBase(aRunnableName, /* aExclusive */ false), mInitialized(false) { AssertIsOnOwningThread(); - - // Overwrite OriginOperationBase default values. - mNeedsStorageInit = false; } RefPtr InitializedRequestBase::CreateDirectoryLock() { @@ -1115,9 +1106,6 @@ void TemporaryStorageInitializedOp::GetResponse(RequestResponse& aResponse) { InitOp::InitOp() : QuotaRequestBase("dom::quota::InitOp", /* aExclusive */ false) { AssertIsOnOwningThread(); - - // Overwrite OriginOperationBase default values. - mNeedsStorageInit = false; } nsresult InitOp::DoDirectoryWork(QuotaManager& aQuotaManager) { @@ -1140,9 +1128,6 @@ InitTemporaryStorageOp::InitTemporaryStorageOp() : QuotaRequestBase("dom::quota::InitTemporaryStorageOp", /* aExclusive */ false) { AssertIsOnOwningThread(); - - // Overwrite OriginOperationBase default values. - mNeedsStorageInit = false; } nsresult InitTemporaryStorageOp::DoDirectoryWork(QuotaManager& aQuotaManager) { @@ -1172,9 +1157,6 @@ InitializeOriginRequestBase::InitializeOriginRequestBase( mCreated(false) { AssertIsOnOwningThread(); - // Overwrite OriginOperationBase default values. - mNeedsStorageInit = false; - // Overwrite NormalOriginOperationBase default values. mPersistenceType.SetValue(aPersistenceType); } @@ -1333,9 +1315,6 @@ ResetOrClearOp::ResetOrClearOp(bool aClear) : QuotaRequestBase("dom::quota::ResetOrClearOp", /* aExclusive */ true), mClear(aClear) { AssertIsOnOwningThread(); - - // Overwrite OriginOperationBase default values. - mNeedsStorageInit = false; } void ResetOrClearOp::DeleteFiles(QuotaManager& aQuotaManager) { @@ -1701,9 +1680,6 @@ ResetOriginOp::ResetOriginOp(const RequestParams& aParams) const auto origin = QuotaManager::GetOriginFromValidatedPrincipalInfo(params.principalInfo()); - // Overwrite OriginOperationBase default values. - mNeedsStorageInit = false; - // Overwrite NormalOriginOperationBase default values. if (params.persistenceTypeIsExplicit()) { mPersistenceType.SetValue(params.persistenceType()); @@ -1906,9 +1882,6 @@ EstimateOp::EstimateOp(const EstimateParams& aParams) : QuotaRequestBase("dom::quota::EstimateOp", /* aExclusive */ false), mParams(aParams) { AssertIsOnOwningThread(); - - // Overwrite OriginOperationBase default values. - mNeedsStorageInit = true; } nsresult EstimateOp::DoInit(QuotaManager& aQuotaManager) {