Bug 1419144 - Part 3: Move pref caches into nsGlobalWindowInner where they are used, r=smaug

MozReview-Commit-ID: 1yftLoS3eo2
This commit is contained in:
Nika Layzell 2017-11-17 16:23:49 -05:00
Родитель 93c45cb3ef
Коммит 486f00a8af
3 изменённых файлов: 9 добавлений и 17 удалений

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

@ -295,7 +295,6 @@ static bool gMouseDown = false;
static bool gDragServiceDisabled = false;
static FILE *gDumpFile = nullptr;
static uint32_t gSerialCounter = 0;
static bool gIdleObserversAPIFuzzTimeDisabled = false;
#ifdef DEBUG_jst
int32_t gTimeoutCnt = 0;
@ -786,19 +785,6 @@ nsPIDOMWindow<T>::GetDocGroup() const
return nullptr;
}
static void
EnsurePrefCaches()
{
static bool sFirstTime = true;
if (sFirstTime) {
TimeoutManager::Initialize();
Preferences::AddBoolVarCache(&gIdleObserversAPIFuzzTimeDisabled,
"dom.idle-observers-api.fuzz_time.disabled",
false);
sFirstTime = false;
}
}
// Include the implementations for the inner and outer windows respectively.
#include "nsGlobalWindowOuter.cpp"
#include "nsGlobalWindowInner.cpp"

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

@ -50,6 +50,7 @@
return; \
PR_END_MACRO
static bool gIdleObserversAPIFuzzTimeDisabled = false;
nsGlobalWindowInner::InnerWindowByIdTable *nsGlobalWindowInner::sInnerWindowsById = nullptr;
@ -676,7 +677,14 @@ nsGlobalWindowInner::nsGlobalWindowInner(nsGlobalWindowOuter *aOuterWindow)
gRefCnt++;
EnsurePrefCaches();
static bool sFirstTime = true;
if (sFirstTime) {
sFirstTime = false;
TimeoutManager::Initialize();
Preferences::AddBoolVarCache(&gIdleObserversAPIFuzzTimeDisabled,
"dom.idle-observers-api.fuzz_time.disabled",
false);
}
if (gDumpFile == nullptr) {
nsAutoCString fname;

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

@ -692,8 +692,6 @@ nsGlobalWindowOuter::nsGlobalWindowOuter()
gRefCnt++;
EnsurePrefCaches();
if (gDumpFile == nullptr) {
nsAutoCString fname;
Preferences::GetCString("browser.dom.window.dump.file", fname);