Bug 1253094, part 6 - Stop using DebugOnly for class/struct members in netwerk/. r=mayhemer draft
authorJonathan Watt <jwatt@jwatt.org>
Wed, 02 Mar 2016 23:55:03 +0000
changeset 336257 ca3e12a665c020b6d26768dbd2235f73d8b20064
parent 336256 b9bcbe8c8fe00ccae7d3340a2bedc2530a6386b6
child 336258 10ca8162c1f1af9e53a0d07ccb3858042e9efa7a
push id12025
push userjwatt@jwatt.org
push dateThu, 03 Mar 2016 00:03:10 +0000
reviewersmayhemer
bugs1253094
milestone47.0a1
Bug 1253094, part 6 - Stop using DebugOnly for class/struct members in netwerk/. r=mayhemer MozReview-Commit-ID: 23nFEyVkF1u
netwerk/cache2/CacheIOThread.cpp
netwerk/cache2/CacheIOThread.h
--- a/netwerk/cache2/CacheIOThread.cpp
+++ b/netwerk/cache2/CacheIOThread.cpp
@@ -22,17 +22,19 @@ CacheIOThread::CacheIOThread()
 : mMonitor("CacheIOThread")
 , mThread(nullptr)
 , mXPCOMThread(nullptr)
 , mLowestLevelWaiting(LAST_LEVEL)
 , mCurrentlyExecutingLevel(0)
 , mHasXPCOMEvents(false)
 , mRerunCurrentEvent(false)
 , mShutdown(false)
+#ifdef DEBUG
 , mInsideLoop(true)
+#endif
 {
   sSelf = this;
 }
 
 CacheIOThread::~CacheIOThread()
 {
   if (mXPCOMThread) {
     nsIThread *thread = mXPCOMThread;
@@ -237,18 +239,20 @@ loopStart:
 
       if (EventsPending())
         continue;
 
     } while (true);
 
     MOZ_ASSERT(!EventsPending());
 
+#ifdef DEBUG
     // This is for correct assertion on XPCOM events dispatch.
     mInsideLoop = false;
+#endif
   } // lock
 
   if (threadInternal)
     threadInternal->SetObserver(nullptr);
 }
 
 static const char* const sLevelTraceName[] = {
   "net::cache::io::level(0)",
--- a/netwerk/cache2/CacheIOThread.h
+++ b/netwerk/cache2/CacheIOThread.h
@@ -91,15 +91,17 @@ private:
   Atomic<nsIThread *> mXPCOMThread;
   Atomic<uint32_t, Relaxed> mLowestLevelWaiting;
   uint32_t mCurrentlyExecutingLevel;
   nsTArray<nsCOMPtr<nsIRunnable> > mEventQueue[LAST_LEVEL];
 
   Atomic<bool, Relaxed> mHasXPCOMEvents;
   bool mRerunCurrentEvent;
   bool mShutdown;
-  DebugOnly<bool> mInsideLoop;
+#ifdef DEBUG
+  bool mInsideLoop;
+#endif
 };
 
 } // namespace net
 } // namespace mozilla
 
 #endif