Bug 1411480 (attempt 2) - Inline and remove pref_SetWatchingPref(). r=glandium.

It's simple enough that having a separate function isn't helpful.

MozReview-Commit-ID: Ke9BIfp9yHU

--HG--
extra : rebase_source : 57aee451b8fd3450da4a604cefbf9fafda894b1c
This commit is contained in:
Nicholas Nethercote 2017-10-26 16:14:00 +11:00
Родитель dc68184056
Коммит 3418db65be
1 изменённых файлов: 4 добавлений и 10 удалений

Просмотреть файл

@ -999,8 +999,6 @@ pref_SetValue(PrefValue* aExistingValue,
static pref_initPhase gPhase = START; static pref_initPhase gPhase = START;
static bool gWatchingPref = false;
static void static void
pref_SetInitPhase(pref_initPhase aPhase) pref_SetInitPhase(pref_initPhase aPhase)
{ {
@ -1013,12 +1011,6 @@ pref_GetInitPhase()
return gPhase; return gPhase;
} }
static void
pref_SetWatchingPref(bool aWatching)
{
gWatchingPref = aWatching;
}
struct StringComparator struct StringComparator
{ {
const char* mKey; const char* mKey;
@ -1038,11 +1030,13 @@ InInitArray(const char* aKey)
return BinarySearchIf(list, 0, prefsLen, StringComparator(aKey), &found); return BinarySearchIf(list, 0, prefsLen, StringComparator(aKey), &found);
} }
static bool gWatchingPref = false;
class WatchingPrefRAII class WatchingPrefRAII
{ {
public: public:
WatchingPrefRAII() { pref_SetWatchingPref(true); } WatchingPrefRAII() { gWatchingPref = true; }
~WatchingPrefRAII() { pref_SetWatchingPref(false); } ~WatchingPrefRAII() { gWatchingPref = false; }
}; };
#define WATCHING_PREF_RAII() WatchingPrefRAII watchingPrefRAII #define WATCHING_PREF_RAII() WatchingPrefRAII watchingPrefRAII