Bug 1570212 - Convert dom.securecontext.whitelist_onions to a static pref. r=mccr8

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nicholas Nethercote 2019-08-02 11:59:06 +00:00
parent cdffde3415
commit dd63fcde4e
2 changed files with 7 additions and 8 deletions

View File

@ -36,6 +36,7 @@
#include "prnetdb.h"
#include "mozilla/Logging.h"
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/Telemetry.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/ipc/URIUtils.h"
@ -387,14 +388,7 @@ bool nsMixedContentBlocker::IsPotentiallyTrustworthyLoopbackURL(nsIURI* aURL) {
* `dom.securecontext.whitelist_onions` is `true`.
*/
bool nsMixedContentBlocker::IsPotentiallyTrustworthyOnion(nsIURI* aURL) {
static bool sInited = false;
static bool sWhiteListOnions = false;
if (!sInited) {
Preferences::AddBoolVarCache(&sWhiteListOnions,
"dom.securecontext.whitelist_onions");
sInited = true;
}
if (!sWhiteListOnions) {
if (!StaticPrefs::dom_securecontext_whitelist_onions()) {
return false;
}

View File

@ -1900,6 +1900,11 @@
value: true
mirror: always
- name: dom.securecontext.whitelist_onions
type: bool
value: false
mirror: always
# This pref enables FeaturePolicy logic and the parsing of 'allow' attribute in
# HTMLIFrameElement objects.
- name: dom.security.featurePolicy.enabled