Bug 1253094, part 9 - Stop using DebugOnly for class/struct members in xpcom/. r=froydnj
MozReview-Commit-ID: 1GTGYN7UwZm
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -1270,17 +1270,19 @@ private:
CycleCollectedJSRuntime* mJSRuntime;
ccPhase mIncrementalPhase;
CCGraph mGraph;
nsAutoPtr<CCGraphBuilder> mBuilder;
RefPtr<nsCycleCollectorLogger> mLogger;
- DebugOnly<void*> mThread;
+#ifdef DEBUG
+ void* mThread;
+#endif
nsCycleCollectorParams mParams;
uint32_t mWhiteNodeCount;
CC_BeforeUnlinkCallback mBeforeUnlinkCB;
CC_ForgetSkippableCallback mForgetSkippableCB;
@@ -3397,17 +3399,19 @@ nsCycleCollector::CollectReports(nsIHand
////////////////////////////////////////////////////////////////////////
nsCycleCollector::nsCycleCollector() :
mActivelyCollecting(false),
mFreeingSnowWhite(false),
mScanInProgress(false),
mJSRuntime(nullptr),
mIncrementalPhase(IdlePhase),
+#ifdef DEBUG
mThread(NS_GetCurrentThread()),
+#endif
mWhiteNodeCount(0),
mBeforeUnlinkCB(nullptr),
mForgetSkippableCB(nullptr),
mUnmergedNeeded(0),
mMergedInARow(0)
{
}
@@ -4020,21 +4024,23 @@ nsCycleCollector_suspectedCount()
}
return data->mCollector->SuspectedCount();
}
bool
nsCycleCollector_init()
{
- static DebugOnly<bool> sInitialized;
+#ifdef DEBUG
+ static bool sInitialized;
MOZ_ASSERT(NS_IsMainThread(), "Wrong thread!");
MOZ_ASSERT(!sInitialized, "Called twice!?");
sInitialized = true;
+#endif
return sCollectorData.init();
}
void
nsCycleCollector_startup()
{
if (sCollectorData.get()) {
--- a/xpcom/base/nsMemoryInfoDumper.cpp
+++ b/xpcom/base/nsMemoryInfoDumper.cpp
@@ -217,17 +217,19 @@ doGCCCDump(const nsCString& aInputStr)
doAllTracesGCCCDump,
/* dumpChildProcesses = */ true);
NS_DispatchToMainThread(runnable);
}
bool
SetupFifo()
{
- static DebugOnly<bool> fifoCallbacksRegistered = false;
+#ifdef DEBUG
+ static bool fifoCallbacksRegistered = false;
+#endif
if (!FifoWatcher::MaybeCreate()) {
return false;
}
MOZ_ASSERT(!fifoCallbacksRegistered,
"FifoWatcher callbacks should be registered only once");
@@ -238,17 +240,19 @@ SetupFifo()
fw->RegisterCallback(NS_LITERAL_CSTRING("minimize memory report"),
doMemoryReport);
// Dump GC and CC logs (from the main thread).
fw->RegisterCallback(NS_LITERAL_CSTRING("gc log"),
doGCCCDump);
fw->RegisterCallback(NS_LITERAL_CSTRING("abbreviated gc log"),
doGCCCDump);
+#ifdef DEBUG
fifoCallbacksRegistered = true;
+#endif
return true;
}
void
OnFifoEnabledChange(const char* /*unused*/, void* /*unused*/)
{
LOG("%s changed", FifoWatcher::kPrefName);
if (SetupFifo()) {