Bug 1343677 part 1. Add a way to get the current preferences init phase in debug builds. r=billm
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 16 Mar 2017 17:43:17 -0400
changeset 348048 55ee07a916b838e153231bf92b0a6fcec4e4b99d
parent 348047 32d95add349fbf758e49cd3ad1e30f4065170288
child 348049 d6b773c155936cbc1f21dbcfe84531976a8bdb22
push id88136
push userbzbarsky@mozilla.com
push dateThu, 16 Mar 2017 21:55:04 +0000
treeherdermozilla-inbound@7b89ee0ae420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1343677
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1343677 part 1. Add a way to get the current preferences init phase in debug builds. r=billm MozReview-Commit-ID: JtHhLuFDu2d
modules/libpref/Preferences.cpp
modules/libpref/Preferences.h
modules/libpref/prefapi.cpp
modules/libpref/prefapi_private_data.h
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -798,16 +798,22 @@ Preferences::GetPreferences(InfallibleTA
 }
 
 #ifdef DEBUG
 void
 Preferences::SetInitPhase(pref_initPhase phase)
 {
   pref_SetInitPhase(phase);
 }
+
+pref_initPhase
+Preferences::InitPhase()
+{
+  return pref_GetInitPhase();
+}
 #endif
 
 NS_IMETHODIMP
 Preferences::GetBranch(const char *aPrefRoot, nsIPrefBranch **_retval)
 {
   nsresult rv;
 
   if ((nullptr != aPrefRoot) && (*aPrefRoot != '\0')) {
--- a/modules/libpref/Preferences.h
+++ b/modules/libpref/Preferences.h
@@ -379,16 +379,17 @@ public:
   static void GetPreferences(InfallibleTArray<PrefSetting>* aPrefs);
   static void GetPreference(PrefSetting* aPref);
   static void SetPreference(const PrefSetting& aPref);
 
   static void SetInitPreferences(nsTArray<PrefSetting>* aPrefs);
 
 #ifdef DEBUG
   static void SetInitPhase(pref_initPhase phase);
+  static pref_initPhase InitPhase();
 #endif
 
   static int64_t SizeOfIncludingThisAndOtherStuff(mozilla::MallocSizeOf aMallocSizeOf);
 
   static void DirtyCallback();
 
 protected:
   virtual ~Preferences();
--- a/modules/libpref/prefapi.cpp
+++ b/modules/libpref/prefapi.cpp
@@ -740,16 +740,22 @@ static pref_initPhase gPhase = START;
 static bool gWatchingPref = false;
 
 void
 pref_SetInitPhase(pref_initPhase phase)
 {
     gPhase = phase;
 }
 
+pref_initPhase
+pref_GetInitPhase()
+{
+    return gPhase;
+}
+
 void
 pref_SetWatchingPref(bool watching)
 {
     gWatchingPref = watching;
 }
 
 
 struct StringComparator
--- a/modules/libpref/prefapi_private_data.h
+++ b/modules/libpref/prefapi_private_data.h
@@ -25,16 +25,19 @@ pref_savePrefs(PLDHashTable* aTable, uin
 
 nsresult
 pref_SetPref(const mozilla::dom::PrefSetting& aPref);
 
 #ifdef DEBUG
 void
 pref_SetInitPhase(pref_initPhase phase);
 
+pref_initPhase
+pref_GetInitPhase();
+
 void
 pref_SetWatchingPref(bool watching);
 #endif
 
 int pref_CompareStrings(const void *v1, const void *v2, void* unused);
 PrefHashEntry* pref_HashTableLookup(const char *key);
 
 bool