Bug 1572505 - Convert network.dns.disablePrefetchFromHTTPS to static pref. r=smaug,njn

Converts network.dns.disablePrefetchFromHTTPS to a static pref. Though the original VarCache pref default to `false`, it looks like the intended value is `true`. (see comment #0 in bug 1572505)

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kristen Wright 2019-08-21 10:11:04 +00:00
Родитель 75e716cf5d
Коммит dacc355ec3
3 изменённых файлов: 8 добавлений и 11 удалений

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

@ -34,6 +34,7 @@
#include "mozilla/StaticPrefs_dom.h"
#include "mozilla/StaticPrefs_full_screen_api.h"
#include "mozilla/StaticPrefs_layout.h"
#include "mozilla/StaticPrefs_network.h"
#include "mozilla/StaticPrefs_page_load.h"
#include "mozilla/StaticPrefs_plugins.h"
#include "mozilla/StaticPrefs_privacy.h"
@ -351,8 +352,6 @@
#define NS_MAX_DOCUMENT_WRITE_DEPTH 20
extern bool sDisablePrefetchHTTPSPref;
mozilla::LazyLogModule gPageCacheLog("PageCache");
namespace mozilla {
@ -3495,7 +3494,8 @@ void Document::RemoveFromIdTable(Element* aElement, nsAtom* aId) {
void Document::SetPrincipals(nsIPrincipal* aNewPrincipal,
nsIPrincipal* aNewStoragePrincipal) {
MOZ_ASSERT(!!aNewPrincipal == !!aNewStoragePrincipal);
if (aNewPrincipal && mAllowDNSPrefetch && sDisablePrefetchHTTPSPref) {
if (aNewPrincipal && mAllowDNSPrefetch &&
StaticPrefs::network_dns_disablePrefetchFromHTTPS()) {
nsCOMPtr<nsIURI> uri;
aNewPrincipal->GetURI(getter_AddRefs(uri));
if (!uri || uri->SchemeIs("https")) {

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

@ -38,7 +38,6 @@ using namespace mozilla::dom;
using namespace mozilla::net;
static NS_DEFINE_CID(kDNSServiceCID, NS_DNSSERVICE_CID);
bool sDisablePrefetchHTTPSPref;
static bool sInitialized = false;
static nsIDNSService* sDNSService = nullptr;
static nsHTMLDNSPrefetch::nsDeferrals* sPrefetches = nullptr;
@ -59,15 +58,8 @@ nsresult nsHTMLDNSPrefetch::Initialize() {
sPrefetches->Activate();
Preferences::AddBoolVarCache(&sDisablePrefetchHTTPSPref,
"network.dns.disablePrefetchFromHTTPS");
Preferences::AddBoolVarCache(&sEsniEnabled, "network.security.esni.enabled");
// Default is false, so we need an explicit call to prime the cache.
sDisablePrefetchHTTPSPref =
Preferences::GetBool("network.dns.disablePrefetchFromHTTPS", true);
sEsniEnabled = Preferences::GetBool("network.security.esni.enabled", false);
NS_IF_RELEASE(sDNSService);

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

@ -5985,6 +5985,11 @@
value: 0
mirror: always
- name: network.dns.disablePrefetchFromHTTPS
type: bool
value: true
mirror: always
# Max time to shutdown the resolver threads
- name: network.dns.resolver_shutdown_timeout_ms
type: uint32_t