Bug 1622111 - Convert dom.use_components_shim to static pref. r=njn

Converts dom.use_components_shim to a static pref and removes its `all.js` entry.

Differential Revision: https://phabricator.services.mozilla.com/D67184

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kristen Wright 2020-03-18 22:09:48 +00:00
parent dd440a3070
commit 5b8ccb75ee
3 changed files with 7 additions and 15 deletions

View File

@ -2813,14 +2813,7 @@ bool nsGlobalWindowInner::DoResolve(
// We support a cut-down Components.interfaces in case websites are
// using Components.interfaces.nsIFoo.CONSTANT_NAME for the ones
// that have constants.
static bool watchingComponentsPref = false;
static bool useComponentsShim = false;
if (!watchingComponentsPref) {
watchingComponentsPref = true;
Preferences::AddBoolVarCache(&useComponentsShim, "dom.use_components_shim",
true);
}
if (useComponentsShim &&
if (StaticPrefs::dom_use_components_shim() &&
aId == XPCJSRuntime::Get()->GetStringID(XPCJSContext::IDX_COMPONENTS)) {
return ResolveComponentsShim(aCx, aObj, aDesc);
}

View File

@ -2657,6 +2657,12 @@
value: 5000
mirror: always
# Whether to shim a Components object on untrusted windows.
- name: dom.use_components_shim
type: bool
value: @IS_NOT_NIGHTLY_BUILD@
mirror: always
- name: dom.vibrator.enabled
type: bool
value: true

View File

@ -1047,13 +1047,6 @@ pref("dom.select_popup_in_parent.enabled", false);
pref("dom.cycle_collector.incremental", true);
// Whether to shim a Components object on untrusted windows.
#ifdef NIGHTLY_BUILD
pref("dom.use_components_shim", false);
#else // NIGHTLY_BUILD
pref("dom.use_components_shim", true);
#endif // NIGHTLY_BUILD
// Disable popups from plugins by default
// 0 = openAllowed
// 1 = openControlled