Bug 1411480 - Inline and remove pref_SetWatchingPref(). r=glandium.
☠☠ backed out by 3c6a28afa74b ☠ ☠
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 25 Oct 2017 10:22:38 +1100
changeset 430892 e87ba9542cf8bac95d16545dfd129f5a39d56a22
parent 430891 f1cf84a50ebc368ad4e2088957cbda008a74520d
child 430893 eaa177ef5f60991f3a2ed06b50c49d3d67ea516b
push id108
push userfmarier@mozilla.com
push dateFri, 03 Nov 2017 18:37:44 +0000
reviewersglandium
bugs1411480
milestone58.0a1
Bug 1411480 - Inline and remove pref_SetWatchingPref(). r=glandium. It's simple enough that having a separate function isn't helpful. MozReview-Commit-ID: Ke9BIfp9yHU
modules/libpref/Preferences.cpp
--- a/modules/libpref/Preferences.cpp
+++ b/modules/libpref/Preferences.cpp
@@ -994,36 +994,28 @@ pref_SetValue(PrefValue* aExistingValue,
 
   return aFlags;
 }
 
 #ifdef DEBUG
 
 static pref_initPhase gPhase = START;
 
-static bool gWatchingPref = false;
-
 static void
 pref_SetInitPhase(pref_initPhase aPhase)
 {
   gPhase = aPhase;
 }
 
 static pref_initPhase
 pref_GetInitPhase()
 {
   return gPhase;
 }
 
-static void
-pref_SetWatchingPref(bool aWatching)
-{
-  gWatchingPref = aWatching;
-}
-
 struct StringComparator
 {
   const char* mKey;
   explicit StringComparator(const char* aKey)
     : mKey(aKey)
   {
   }
   int operator()(const char* aString) const { return strcmp(mKey, aString); }
@@ -1033,21 +1025,23 @@ static bool
 InInitArray(const char* aKey)
 {
   size_t prefsLen;
   size_t found;
   const char** list = mozilla::dom::ContentPrefs::GetContentPrefs(&prefsLen);
   return BinarySearchIf(list, 0, prefsLen, StringComparator(aKey), &found);
 }
 
+static bool gWatchingPref = false;
+
 class WatchingPrefRAII
 {
 public:
-  WatchingPrefRAII() { pref_SetWatchingPref(true); }
-  ~WatchingPrefRAII() { pref_SetWatchingPref(false); }
+  WatchingPrefRAII() { gWatchingPref = true; }
+  ~WatchingPrefRAII() { gWatchingPref = false; }
 };
 
 #define WATCHING_PREF_RAII() WatchingPrefRAII watchingPrefRAII
 
 #else // DEBUG
 
 #define WATCHING_PREF_RAII()