Bug 1417806 - Add a comment about gCacheData. r=glandium draft
authorNicholas Nethercote <nnethercote@mozilla.com>
Thu, 16 Nov 2017 18:39:00 +1100
changeset 698937 3c7b35684b94b8aeabb73e0eb278a51ef8a4697b
parent 698936 1f7d337875d5f554772bec6395e7f4241900a26c
child 698938 5780456f1f0cf18f98ab3b42efcaec514324a171
push id89395
push usernnethercote@mozilla.com
push dateThu, 16 Nov 2017 08:14:02 +0000
reviewersglandium
bugs1417806
milestone59.0a1
Bug 1417806 - Add a comment about gCacheData. r=glandium MozReview-Commit-ID: 1oVYUMtobRF
modules/libpref/Preferences.cpp
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -3151,16 +3151,20 @@ struct CacheData
     uint32_t mDefaultValueUint;
     float mDefaultValueFloat;
   };
 };
 
 // gCacheDataDesc holds information about prefs startup. It's being used for
 // diagnosing prefs startup problems in bug 1276488.
 static const char* gCacheDataDesc = "untouched";
+
+// gCacheData holds the CacheData objects used for VarCache prefs. It owns
+// those objects, and also is used to detect if multiple VarCaches get tied to
+// a single global variable.
 static nsTArray<nsAutoPtr<CacheData>>* gCacheData = nullptr;
 
 #ifdef DEBUG
 static bool
 HaveExistingCacheFor(void* aPtr)
 {
   MOZ_ASSERT(NS_IsMainThread());
   if (gCacheData) {