From 5109d15769cb6f9d7ff2a4fa43924827e2959357 Mon Sep 17 00:00:00 2001 From: Ryan VanderMeulen Date: Fri, 10 Jul 2015 12:35:15 -0400 Subject: [PATCH] Backed out changeset d29782c360fe (bug 1180978) for causing indexedDB assertions. CLOSED TREE --- dom/indexedDB/ActorsParent.cpp | 22 ++----------- dom/indexedDB/test/unit/test_blocked_order.js | 31 +------------------ 2 files changed, 3 insertions(+), 50 deletions(-) diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index 2e0cdec74531..21e9129b2909 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -12432,8 +12432,6 @@ Database::RegisterTransaction(TransactionBase* aTransaction) MOZ_ASSERT(aTransaction); MOZ_ASSERT(!mTransactions.GetEntry(aTransaction)); MOZ_ASSERT(mDirectoryLock); - MOZ_ASSERT(!mInvalidated); - MOZ_ASSERT(!mClosed); if (NS_WARN_IF(!mTransactions.PutEntry(aTransaction, fallible))) { return false; @@ -18843,10 +18841,6 @@ FactoryOp::Run() SendResults(); return NS_OK; - // We raced, no need to crash. - case State_Completed: - return NS_OK; - default: MOZ_CRASH("Bad state!"); } @@ -18904,16 +18898,6 @@ FactoryOp::ActorDestroy(ActorDestroyReason aWhy) AssertIsOnBackgroundThread(); NoteActorDestroyed(); - - if (mState != State_SendingResults) { - // Let's see if this is right ... - MOZ_RELEASE_ASSERT(mState == State_WaitingForTransactionsToComplete); - // We didn't get an opportunity to clean up. Do that now. - mState = State_SendingResults; - IDB_REPORT_INTERNAL_ERR(); - mResultCode = NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR; - SendResults(); - } } bool @@ -19510,10 +19494,9 @@ OpenDatabaseOp::NoteDatabaseClosed(Database* aDatabase) AssertIsOnOwningThread(); MOZ_ASSERT(aDatabase); MOZ_ASSERT(mState == State_WaitingForOtherDatabasesToClose || - mState == State_WaitingForTransactionsToComplete || mState == State_DatabaseWorkVersionChange); - if (mState != State_WaitingForOtherDatabasesToClose) { + if (mState == State_DatabaseWorkVersionChange) { MOZ_ASSERT(mMaybeBlockedDatabases.IsEmpty()); MOZ_ASSERT(mRequestedVersion > aDatabase->Metadata()->mCommonMetadata.version(), @@ -19577,8 +19560,7 @@ OpenDatabaseOp::DispatchToWorkThread() MOZ_ASSERT(mMaybeBlockedDatabases.IsEmpty()); if (NS_WARN_IF(QuotaClient::IsShuttingDownOnNonMainThread()) || - IsActorDestroyed() || - mDatabase->IsInvalidated()) { + IsActorDestroyed()) { IDB_REPORT_INTERNAL_ERR(); return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR; } diff --git a/dom/indexedDB/test/unit/test_blocked_order.js b/dom/indexedDB/test/unit/test_blocked_order.js index 28aa3cb87cdc..3e54ccece6ca 100644 --- a/dom/indexedDB/test/unit/test_blocked_order.js +++ b/dom/indexedDB/test/unit/test_blocked_order.js @@ -56,7 +56,7 @@ function testSteps() ok(false, "Should not receive a blocked event"); }; - let event = yield undefined; + event = yield undefined; is(event.type, "success", "Got success event"); is(databases.length, 0, "All databases with version 1 were closed"); @@ -145,35 +145,6 @@ function testSteps() is(event.type, "success", "Got success event"); - // Test 3: A blocked database left in that state should not hang shutdown. - info("Opening 1 database with version 1"); - - request = indexedDB.open(databaseName, 1); - request.onerror = errorHandler; - request.onblocked = errorHandler; - request.onsuccess = grabEventAndContinueHandler; - - event = yield undefined; - - is(event.type, "success", "Got success event"); - - db = request.result; - is(db.version, 1, "Got version 1"); - - info("Opening database with version 2"); - - request = indexedDB.open(databaseName, 2); - request.onerror = function(e) { - e.preventDefault(); - }; - request.onsuccess = errorHandler; - - request.onblocked = grabEventAndContinueHandler; - - event = yield undefined; - ok(true, "Got blocked"); - // Just allow this to remain blocked ... - finishTest(); yield undefined; }