mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
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 --HG-- extra : rebase_source : de1518544ddb28185635628c33d356ab07480c1c
This commit is contained in:
parent
529db19e62
commit
49e302c18e
@ -999,8 +999,6 @@ pref_SetValue(PrefValue* aExistingValue,
|
||||
|
||||
static pref_initPhase gPhase = START;
|
||||
|
||||
static bool gWatchingPref = false;
|
||||
|
||||
static void
|
||||
pref_SetInitPhase(pref_initPhase aPhase)
|
||||
{
|
||||
@ -1013,12 +1011,6 @@ pref_GetInitPhase()
|
||||
return gPhase;
|
||||
}
|
||||
|
||||
static void
|
||||
pref_SetWatchingPref(bool aWatching)
|
||||
{
|
||||
gWatchingPref = aWatching;
|
||||
}
|
||||
|
||||
struct StringComparator
|
||||
{
|
||||
const char* mKey;
|
||||
@ -1038,11 +1030,13 @@ InInitArray(const char* aKey)
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user