Bug 1189426 - Don't assert false in DOMStorageDBThread::InsertDBOp when we failed to open the database. r=smaug
authorHonza Bambas <honzab.moz@firemni.cz>
Thu, 06 Aug 2015 11:08:00 -0400
changeset 288493 28148663ff57887c2209c9c50301332fc4568608
parent 288492 2336fd9dcb91aa68ce296a7dc716b4842ae9a654
child 288494 b4fed4b50af5503c3653404a40e992e6a77f1d87
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1189426
milestone42.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 1189426 - Don't assert false in DOMStorageDBThread::InsertDBOp when we failed to open the database. r=smaug
dom/storage/DOMStorageDBThread.cpp
--- a/dom/storage/DOMStorageDBThread.cpp
+++ b/dom/storage/DOMStorageDBThread.cpp
@@ -182,28 +182,28 @@ DOMStorageDBThread::GetScopesHavingData(
 nsresult
 DOMStorageDBThread::InsertDBOp(DOMStorageDBThread::DBOperation* aOperation)
 {
   MonitorAutoLock monitor(mThreadObserver->GetMonitor());
 
   // Sentinel to don't forget to delete the operation when we exit early.
   nsAutoPtr<DOMStorageDBThread::DBOperation> opScope(aOperation);
 
+  if (NS_FAILED(mStatus)) {
+    MonitorAutoUnlock unlock(mThreadObserver->GetMonitor());
+    aOperation->Finalize(mStatus);
+    return mStatus;
+  }
+
   if (mStopIOThread) {
     // Thread use after shutdown demanded.
     MOZ_ASSERT(false);
     return NS_ERROR_NOT_INITIALIZED;
   }
 
-  if (NS_FAILED(mStatus)) {
-    MonitorAutoUnlock unlock(mThreadObserver->GetMonitor());
-    aOperation->Finalize(mStatus);
-    return mStatus;
-  }
-
   switch (aOperation->Type()) {
   case DBOperation::opPreload:
   case DBOperation::opPreloadUrgent:
     if (mPendingTasks.IsScopeUpdatePending(aOperation->Scope())) {
       // If there is a pending update operation for the scope first do the flush
       // before we preload the cache.  This may happen in an extremely rare case
       // when a child process throws away its cache before flush on the parent
       // has finished.  If we would preloaded the cache as a priority operation