Bug 912935 - Initialize mWALModeEnabled to false upon creation of DOMStorageDBThread::DOMStorageDBThread() and also reorder of access in an if-expression. r=mayhemer
authorISHIKAWA, Chiaki <ishikawa@yk.rim.or.jp>
Tue, 10 Sep 2013 13:40:18 -0400
changeset 146449 67dfa713bd14f3b1b3fe061f0195c970f3765a78
parent 146448 4e8db3422a37c2a99de9941599e3b6a68433c81c
child 146450 9e473e727e962c5b0e70d794838101436479fc42
push id25260
push userryanvm@gmail.com
push dateWed, 11 Sep 2013 00:29:30 +0000
treeherdermozilla-central@f73bed2856a8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmayhemer
bugs912935
milestone26.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 912935 - Initialize mWALModeEnabled to false upon creation of DOMStorageDBThread::DOMStorageDBThread() and also reorder of access in an if-expression. r=mayhemer
dom/src/storage/DOMStorageDBThread.cpp
--- a/dom/src/storage/DOMStorageDBThread.cpp
+++ b/dom/src/storage/DOMStorageDBThread.cpp
@@ -52,16 +52,17 @@ DOMStorageDBBridge::GetScopeUsage(const 
   return usage;
 }
 
 
 DOMStorageDBThread::DOMStorageDBThread()
 : mThread(nullptr)
 , mMonitor("DOMStorageThreadMonitor")
 , mStopIOThread(false)
+, mWALModeEnabled(false)
 , mDBReady(false)
 , mStatus(NS_OK)
 , mWorkerStatements(mWorkerConnection)
 , mReaderStatements(mReaderConnection)
 , mDirtyEpoch(0)
 , mFlushImmediately(false)
 , mPriorityCounter(0)
 {
@@ -135,17 +136,17 @@ DOMStorageDBThread::SyncPreload(DOMStora
     aCache->LoadWait();
     SetDefaultPriority();
     return;
   }
 
   // Bypass sync load when an update is pending in the queue to write, we would
   // get incosistent data in the cache.  Also don't allow sync main-thread preload
   // when DB open and init is still pending on the background thread.
-  if (mWALModeEnabled && mDBReady) {
+  if (mDBReady && mWALModeEnabled) {
     bool pendingTasks;
     {
       MonitorAutoLock monitor(mMonitor);
       pendingTasks = mPendingTasks.IsScopeUpdatePending(aCache->Scope()) ||
                      mPendingTasks.IsScopeClearPending(aCache->Scope());
     }
 
     if (!pendingTasks) {