зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
dc68184056
Коммит
3418db65be
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче