Bug 1717990 - LSNG: Convert some NS_ERROR_FAILURE which should have been NS_ERROR_ABORT; r=dom-storage-reviewers,jstutte
authorJan Varga <jvarga@mozilla.com>
Fri, 25 Jun 2021 06:27:59 +0000
changeset 584360 e6f061cfca597766cb15df59321e3fc4552e149c
parent 584359 68f759c171f29cd56e583d5a08276607aeaadde7
child 584361 74ceabefad3f03602626af9fae26cbd7d83446fe
push id38563
push usercbrindusan@mozilla.com
push dateFri, 25 Jun 2021 09:34:36 +0000
treeherdermozilla-central@531323de1a48 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdom-storage-reviewers, jstutte
bugs1717990
milestone91.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1717990 - LSNG: Convert some NS_ERROR_FAILURE which should have been NS_ERROR_ABORT; r=dom-storage-reviewers,jstutte Differential Revision: https://phabricator.services.mozilla.com/D118677
dom/localstorage/ActorsParent.cpp
--- a/dom/localstorage/ActorsParent.cpp
+++ b/dom/localstorage/ActorsParent.cpp
@@ -3738,17 +3738,17 @@ void ConnectionDatastoreOperationBase::O
 }
 
 void ConnectionDatastoreOperationBase::RunOnConnectionThread() {
   AssertIsOnGlobalConnectionThread();
   MOZ_ASSERT(mConnection);
   MOZ_ASSERT(NS_SUCCEEDED(ResultCode()));
 
   if (!MayProceedOnNonOwningThread()) {
-    SetFailureCode(NS_ERROR_FAILURE);
+    SetFailureCode(NS_ERROR_ABORT);
   } else {
     nsresult rv = NS_OK;
 
     // The boolean flag is only used by the CloseOp to avoid creating empty
     // databases.
     if (mEnsureStorageConnection) {
       rv = mConnection->EnsureStorageConnection();
       if (NS_WARN_IF(NS_FAILED(rv))) {
@@ -3769,17 +3769,17 @@ void ConnectionDatastoreOperationBase::R
   MOZ_ALWAYS_SUCCEEDS(OwningEventTarget()->Dispatch(this, NS_DISPATCH_NORMAL));
 }
 
 void ConnectionDatastoreOperationBase::RunOnOwningThread() {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mConnection);
 
   if (!MayProceed()) {
-    MaybeSetFailureCode(NS_ERROR_FAILURE);
+    MaybeSetFailureCode(NS_ERROR_ABORT);
   }
 
   if (NS_SUCCEEDED(ResultCode())) {
     OnSuccess();
   } else {
     OnFailure(ResultCode());
   }
 
@@ -6129,17 +6129,17 @@ bool LSRequestBase::VerifyRequestParams(
 }
 
 nsresult LSRequestBase::StartRequest() {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mState == State::StartingRequest);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
-    return NS_ERROR_FAILURE;
+    return NS_ERROR_ABORT;
   }
 
 #ifdef DEBUG
   // Always verify parameters in DEBUG builds!
   bool trustParams = false;
 #else
   bool trustParams = !BackgroundParent::IsOtherProcessActor(Manager());
 #endif
@@ -6154,33 +6154,33 @@ nsresult LSRequestBase::StartRequest() {
 }
 
 void LSRequestBase::SendReadyMessage() {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mState == State::SendingReadyMessage);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
-    MaybeSetFailureCode(NS_ERROR_FAILURE);
+    MaybeSetFailureCode(NS_ERROR_ABORT);
   }
 
   nsresult rv = SendReadyMessageInternal();
   if (NS_WARN_IF(NS_FAILED(rv))) {
     MaybeSetFailureCode(rv);
 
     FinishInternal();
   }
 }
 
 nsresult LSRequestBase::SendReadyMessageInternal() {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mState == State::SendingReadyMessage);
 
   if (!MayProceed()) {
-    return NS_ERROR_FAILURE;
+    return NS_ERROR_ABORT;
   }
 
   if (NS_WARN_IF(!SendReady())) {
     return NS_ERROR_FAILURE;
   }
 
   mState = State::WaitingForFinish;
 
@@ -6213,17 +6213,17 @@ void LSRequestBase::FinishInternal() {
 }
 
 void LSRequestBase::SendResults() {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mState == State::SendingResults);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
-    MaybeSetFailureCode(NS_ERROR_FAILURE);
+    MaybeSetFailureCode(NS_ERROR_ABORT);
   }
 
   if (MayProceed()) {
     LSRequestResponse response;
 
     if (NS_SUCCEEDED(ResultCode())) {
       GetResponse(response);
 
@@ -6529,17 +6529,17 @@ nsresult PrepareDatastoreOp::Start() {
 nsresult PrepareDatastoreOp::CheckExistingOperations() {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mState == State::Nesting);
   MOZ_ASSERT(mNestedState == NestedState::CheckExistingOperations);
   MOZ_ASSERT(gPrepareDatastoreOps);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
-    return NS_ERROR_FAILURE;
+    return NS_ERROR_ABORT;
   }
 
   const LSRequestCommonParams& commonParams =
       mForPreload
           ? mParams.get_LSRequestPreloadDatastoreParams().commonParams()
           : mParams.get_LSRequestPrepareDatastoreParams().commonParams();
 
   const PrincipalInfo& storagePrincipalInfo =
@@ -6606,17 +6606,17 @@ nsresult PrepareDatastoreOp::CheckExisti
 
 nsresult PrepareDatastoreOp::CheckClosingDatastore() {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mState == State::Nesting);
   MOZ_ASSERT(mNestedState == NestedState::CheckClosingDatastore);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
-    return NS_ERROR_FAILURE;
+    return NS_ERROR_ABORT;
   }
 
   QM_TRY(CheckClosingDatastoreInternal());
 
   return NS_OK;
 }
 
 nsresult PrepareDatastoreOp::CheckClosingDatastoreInternal() {
@@ -6642,17 +6642,17 @@ nsresult PrepareDatastoreOp::CheckClosin
 
 nsresult PrepareDatastoreOp::BeginDatastorePreparation() {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mState == State::Nesting);
   MOZ_ASSERT(mNestedState == NestedState::PreparationPending);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
-    return NS_ERROR_FAILURE;
+    return NS_ERROR_ABORT;
   }
 
   QM_TRY(BeginDatastorePreparationInternal());
 
   return NS_OK;
 }
 
 nsresult PrepareDatastoreOp::BeginDatastorePreparationInternal() {
@@ -6689,17 +6689,17 @@ nsresult PrepareDatastoreOp::BeginDatast
 
 nsresult PrepareDatastoreOp::QuotaManagerOpen() {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mState == State::Nesting);
   MOZ_ASSERT(mNestedState == NestedState::QuotaManagerPending);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
-    return NS_ERROR_FAILURE;
+    return NS_ERROR_ABORT;
   }
 
   QM_TRY(OkIf(QuotaManager::Get()), NS_ERROR_FAILURE);
 
   QM_TRY(OpenDirectory());
 
   return NS_OK;
 }
@@ -6791,17 +6791,17 @@ nsresult PrepareDatastoreOp::DatabaseWor
         firstInitializationAttempt.Pending()
             ? Some(ScopedLogExtraInfo{
                   ScopedLogExtraInfo::kTagContext,
                   "dom::localstorage::FirstOriginInitializationAttempt::Datastore"_ns})
             : Nothing{};
 
     if (NS_WARN_IF(QuotaClient::IsShuttingDownOnNonBackgroundThread()) ||
         !MayProceedOnNonOwningThread()) {
-      return NS_ERROR_FAILURE;
+      return NS_ERROR_ABORT;
     }
 
     QuotaManager* quotaManager = QuotaManager::Get();
     MOZ_ASSERT(quotaManager);
 
     // This must be called before EnsureTemporaryStorageIsInitialized.
     QM_TRY(quotaManager->EnsureStorageIsInitialized());
 
@@ -7144,17 +7144,17 @@ already_AddRefed<QuotaObject> PrepareDat
 nsresult PrepareDatastoreOp::BeginLoadData() {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mState == State::Nesting);
   MOZ_ASSERT(mNestedState == NestedState::BeginLoadData);
   MOZ_ASSERT(!mConnection);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
-    return NS_ERROR_FAILURE;
+    return NS_ERROR_ABORT;
   }
 
   if (!gConnectionThread) {
     gConnectionThread = new ConnectionThread();
   }
 
   mConnection = gConnectionThread->CreateConnection(
       mOriginMetadata, std::move(mArchivedOriginScope),
@@ -7468,17 +7468,17 @@ void PrepareDatastoreOp::DirectoryLockAc
   MOZ_ASSERT(mState == State::Nesting);
   MOZ_ASSERT(mNestedState == NestedState::DirectoryOpenPending);
   MOZ_ASSERT(!mDirectoryLock);
 
   mPendingDirectoryLock = nullptr;
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
-    MaybeSetFailureCode(NS_ERROR_FAILURE);
+    MaybeSetFailureCode(NS_ERROR_ABORT);
 
     FinishNesting();
 
     return;
   }
 
   mDirectoryLock = aLock;
 
@@ -7503,17 +7503,17 @@ nsresult PrepareDatastoreOp::LoadDataOp:
   MOZ_ASSERT(mConnection);
   MOZ_ASSERT(mPrepareDatastoreOp);
   MOZ_ASSERT(mPrepareDatastoreOp->mState == State::Nesting);
   MOZ_ASSERT(mPrepareDatastoreOp->mNestedState ==
              NestedState::DatabaseWorkLoadData);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnNonBackgroundThread()) ||
       !MayProceedOnNonOwningThread()) {
-    return NS_ERROR_FAILURE;
+    return NS_ERROR_ABORT;
   }
 
   QM_TRY_INSPECT(const auto& stmt,
                  mConnection->BorrowCachedStatement(
                      "SELECT key, value, utf16Length, compressed "
                      "FROM data;"_ns));
 
   QM_TRY(quota::CollectWhileHasResult(
@@ -7759,17 +7759,17 @@ bool LSSimpleRequestBase::VerifyRequestP
 }
 
 nsresult LSSimpleRequestBase::StartRequest() {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mState == State::StartingRequest);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
-    return NS_ERROR_FAILURE;
+    return NS_ERROR_ABORT;
   }
 
 #ifdef DEBUG
   // Always verify parameters in DEBUG builds!
   bool trustParams = false;
 #else
   bool trustParams = !BackgroundParent::IsOtherProcessActor(Manager());
 #endif
@@ -7784,17 +7784,17 @@ nsresult LSSimpleRequestBase::StartReque
 }
 
 void LSSimpleRequestBase::SendResults() {
   AssertIsOnOwningThread();
   MOZ_ASSERT(mState == State::SendingResults);
 
   if (NS_WARN_IF(QuotaClient::IsShuttingDownOnBackgroundThread()) ||
       !MayProceed()) {
-    MaybeSetFailureCode(NS_ERROR_FAILURE);
+    MaybeSetFailureCode(NS_ERROR_ABORT);
   }
 
   if (MayProceed()) {
     LSSimpleRequestResponse response;
 
     if (NS_SUCCEEDED(ResultCode())) {
       GetResponse(response);
     } else {