Bug 1253094, part 6 - Stop using DebugOnly for class/struct members in netwerk/. r=mayhemer
MozReview-Commit-ID: 23nFEyVkF1u
--- 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