Bug 1253094, part 7 - Stop using DebugOnly for class/struct members in storage/. r=mak draft
authorJonathan Watt <jwatt@jwatt.org>
Wed, 02 Mar 2016 23:56:07 +0000
changeset 336258 10ca8162c1f1af9e53a0d07ccb3858042e9efa7a
parent 336257 ca3e12a665c020b6d26768dbd2235f73d8b20064
child 336259 6b7a71837c75e12c950683016195fa9332c9625d
child 336304 cc93614f7f9cce84eb1b193046ee559ed4d77949
push id12025
push userjwatt@jwatt.org
push dateThu, 03 Mar 2016 00:03:10 +0000
reviewersmak
bugs1253094
milestone47.0a1
Bug 1253094, part 7 - Stop using DebugOnly for class/struct members in storage/. r=mak MozReview-Commit-ID: EOIRlwurAmI
storage/mozStorageConnection.cpp
storage/mozStorageConnection.h
--- a/storage/mozStorageConnection.cpp
+++ b/storage/mozStorageConnection.cpp
@@ -468,17 +468,19 @@ private:
 Connection::Connection(Service *aService,
                        int aFlags,
                        bool aAsyncOnly)
 : sharedAsyncExecutionMutex("Connection::sharedAsyncExecutionMutex")
 , sharedDBMutex("Connection::sharedDBMutex")
 , threadOpenedOn(do_GetCurrentThread())
 , mDBConn(nullptr)
 , mAsyncExecutionThreadShuttingDown(false)
+#ifdef DEBUG
 , mAsyncExecutionThreadIsAlive(false)
+#endif
 , mConnectionClosed(false)
 , mTransactionInProgress(false)
 , mProgressHandler(nullptr)
 , mFlags(aFlags)
 , mStorageService(aService)
 , mAsyncOnly(aAsyncOnly)
 {
   mStorageService->registerConnection(this);
@@ -554,17 +556,20 @@ Connection::getAsyncExecutionTarget()
       NS_WARNING("Failed to create async thread.");
       return nullptr;
     }
     static nsThreadPoolNaming naming;
     naming.SetThreadPoolName(NS_LITERAL_CSTRING("mozStorage"),
                              mAsyncExecutionThread);
   }
 
+#ifdef DEBUG
   mAsyncExecutionThreadIsAlive = true;
+#endif
+
   return mAsyncExecutionThread;
 }
 
 nsresult
 Connection::initialize()
 {
   NS_ASSERTION (!mDBConn, "Initialize called on already opened database!");
   PROFILER_LABEL("mozStorageConnection", "initialize",
@@ -890,17 +895,19 @@ Connection::isClosed()
 void
 Connection::shutdownAsyncThread(nsIThread *aThread) {
   MOZ_ASSERT(!mAsyncExecutionThread);
   MOZ_ASSERT(mAsyncExecutionThreadIsAlive);
   MOZ_ASSERT(mAsyncExecutionThreadShuttingDown);
 
   DebugOnly<nsresult> rv = aThread->Shutdown();
   MOZ_ASSERT(NS_SUCCEEDED(rv));
+#ifdef DEBUG
   mAsyncExecutionThreadIsAlive = false;
+#endif
 }
 
 nsresult
 Connection::internalClose(sqlite3 *aNativeConnection)
 {
   // Sanity checks to make sure we are in the proper state before calling this.
   // aNativeConnection can be null if OpenAsyncDatabase failed and is now just
   // cleaning up the async thread.
--- a/storage/mozStorageConnection.h
+++ b/storage/mozStorageConnection.h
@@ -315,17 +315,19 @@ private:
    * sharedAsyncExecutionMutex.
    */
   bool mAsyncExecutionThreadShuttingDown;
 
   /**
    * Tracks whether the async thread has been initialized and Shutdown() has
    * not yet been invoked on it.
    */
-  DebugOnly<bool> mAsyncExecutionThreadIsAlive;
+#ifdef DEBUG
+  bool mAsyncExecutionThreadIsAlive;
+#endif
 
   /**
    * Set to true just prior to calling sqlite3_close on the
    * connection.
    *
    * This variable should be accessed while holding the
    * sharedAsyncExecutionMutex.
    */