Bug 1490044 - Move all prefs used in WebIDL to StaticPrefs. r=bzbarsky

Differential Revision: https://phabricator.services.mozilla.com/D33507
This commit is contained in:
Peter Van der Beken
2019-06-13 09:00:59 +00:00
parent e71934492d
commit 6c1f25a923
48 changed files with 701 additions and 459 deletions

View File

@@ -11,6 +11,7 @@
#include "mozilla/dom/WindowProxyHolder.h"
#include "mozilla/Preferences.h"
#include "mozilla/PresShell.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/ErrorResult.h"
#include "GeckoProfiler.h"
#include "nsAttrValueInlines.h"
@@ -318,7 +319,8 @@ nsresult nsGenericHTMLFrameElement::AfterSetAttr(
}
}
} else if (aName == nsGkAtoms::mozbrowser) {
mReallyIsBrowser = !!aValue && BrowserFramesEnabled() &&
mReallyIsBrowser = !!aValue &&
StaticPrefs::dom_mozBrowserFramesEnabled() &&
PrincipalAllowsBrowserFrame(NodePrincipal());
}
}
@@ -409,26 +411,6 @@ bool nsGenericHTMLFrameElement::IsHTMLFocusable(bool aWithMouse,
return false;
}
static bool sMozBrowserFramesEnabled = false;
#ifdef DEBUG
static bool sBoolVarCacheInitialized = false;
#endif
void nsGenericHTMLFrameElement::InitStatics() {
MOZ_ASSERT(!sBoolVarCacheInitialized);
MOZ_ASSERT(NS_IsMainThread());
Preferences::AddBoolVarCache(&sMozBrowserFramesEnabled,
"dom.mozBrowserFramesEnabled");
#ifdef DEBUG
sBoolVarCacheInitialized = true;
#endif
}
bool nsGenericHTMLFrameElement::BrowserFramesEnabled() {
MOZ_ASSERT(sBoolVarCacheInitialized);
return sMozBrowserFramesEnabled;
}
/**
* Return true if this frame element really is a mozbrowser. (It
* needs to have the right attributes, and its creator must have the right