Bug 1253094, part 9 - Stop using DebugOnly for class/struct members in xpcom/. r=froydnj draft
authorJonathan Watt <jwatt@jwatt.org>
Wed, 02 Mar 2016 23:58:10 +0000
changeset 336260 6c533769d9385920308aa316b8c244baf7b7186f
parent 336259 6b7a71837c75e12c950683016195fa9332c9625d
child 336261 62674595ac8cdbff258558dbfc0462a8d6ce9227
push id12025
push userjwatt@jwatt.org
push dateThu, 03 Mar 2016 00:03:10 +0000
reviewersfroydnj
bugs1253094
milestone47.0a1
Bug 1253094, part 9 - Stop using DebugOnly for class/struct members in xpcom/. r=froydnj MozReview-Commit-ID: 1GTGYN7UwZm
xpcom/base/nsCycleCollector.cpp
xpcom/base/nsMemoryInfoDumper.cpp
--- 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()) {