mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Remove network.enableIDN pref. Bug 842282, r=honza.b
This commit is contained in:
parent
9c4d3979e3
commit
3db2434df6
@ -1041,10 +1041,6 @@ pref("dom.server-events.default-reconnection-time", 5000); // in milliseconds
|
||||
// by the jar channel.
|
||||
pref("network.jar.open-unsafe-types", false);
|
||||
|
||||
// This preference controls whether or not internationalized domain names (IDN)
|
||||
// are handled. IDN requires a nsIIDNService implementation.
|
||||
pref("network.enableIDN", true);
|
||||
|
||||
// This preference, if true, causes all UTF-8 domain names to be normalized to
|
||||
// punycode. The intention is to allow UTF-8 domain names as input, but never
|
||||
// generate them from punycode.
|
||||
|
@ -110,7 +110,6 @@ end:
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#define NS_NET_PREF_ESCAPEUTF8 "network.standard-url.escape-utf8"
|
||||
#define NS_NET_PREF_ENABLEIDN "network.enableIDN"
|
||||
#define NS_NET_PREF_ALWAYSENCODEINUTF8 "network.standard-url.encode-utf8"
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsStandardURL::nsPrefObserver, nsIObserver)
|
||||
@ -316,7 +315,6 @@ nsStandardURL::InitGlobalObjects()
|
||||
nsCOMPtr<nsIObserver> obs( new nsPrefObserver() );
|
||||
prefBranch->AddObserver(NS_NET_PREF_ESCAPEUTF8, obs.get(), false);
|
||||
prefBranch->AddObserver(NS_NET_PREF_ALWAYSENCODEINUTF8, obs.get(), false);
|
||||
prefBranch->AddObserver(NS_NET_PREF_ENABLEIDN, obs.get(), false);
|
||||
|
||||
PrefsChanged(prefBranch, nullptr);
|
||||
}
|
||||
@ -410,6 +408,13 @@ nsStandardURL::NormalizeIDN(const nsCSubstring &host, nsCString &result)
|
||||
NS_ASSERTION(mHostEncoding == eEncoding_ASCII, "unexpected default encoding");
|
||||
|
||||
bool isASCII;
|
||||
if (!gIDN) {
|
||||
nsCOMPtr<nsIIDNService> serv(do_GetService(NS_IDNSERVICE_CONTRACTID));
|
||||
if (serv) {
|
||||
NS_ADDREF(gIDN = serv.get());
|
||||
}
|
||||
}
|
||||
|
||||
if (gIDN &&
|
||||
NS_SUCCEEDED(gIDN->ConvertToDisplayIDN(host, &isASCII, result))) {
|
||||
if (!isASCII)
|
||||
@ -887,17 +892,6 @@ nsStandardURL::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
|
||||
#define PREF_CHANGED(p) ((pref == nullptr) || !strcmp(pref, p))
|
||||
#define GOT_PREF(p, b) (NS_SUCCEEDED(prefs->GetBoolPref(p, &b)))
|
||||
|
||||
if (PREF_CHANGED(NS_NET_PREF_ENABLEIDN)) {
|
||||
NS_IF_RELEASE(gIDN);
|
||||
if (GOT_PREF(NS_NET_PREF_ENABLEIDN, val) && val) {
|
||||
// initialize IDN
|
||||
nsCOMPtr<nsIIDNService> serv(do_GetService(NS_IDNSERVICE_CONTRACTID));
|
||||
if (serv)
|
||||
NS_ADDREF(gIDN = serv.get());
|
||||
}
|
||||
LOG(("IDN support %s\n", gIDN ? "enabled" : "disabled"));
|
||||
}
|
||||
|
||||
if (PREF_CHANGED(NS_NET_PREF_ESCAPEUTF8)) {
|
||||
if (GOT_PREF(NS_NET_PREF_ESCAPEUTF8, val))
|
||||
gEscapeUTF8 = val;
|
||||
|
@ -36,7 +36,6 @@ using namespace mozilla::net;
|
||||
static const char kPrefDnsCacheEntries[] = "network.dnsCacheEntries";
|
||||
static const char kPrefDnsCacheExpiration[] = "network.dnsCacheExpiration";
|
||||
static const char kPrefDnsCacheGrace[] = "network.dnsCacheExpirationGracePeriod";
|
||||
static const char kPrefEnableIDN[] = "network.enableIDN";
|
||||
static const char kPrefIPv4OnlyDomains[] = "network.dns.ipv4OnlyDomains";
|
||||
static const char kPrefDisableIPv6[] = "network.dns.disableIPv6";
|
||||
static const char kPrefDisablePrefetch[] = "network.dns.disablePrefetch";
|
||||
@ -379,7 +378,6 @@ nsDNSService::Init()
|
||||
uint32_t maxCacheEntries = 400;
|
||||
uint32_t maxCacheLifetime = 2; // minutes
|
||||
uint32_t lifetimeGracePeriod = 1;
|
||||
bool enableIDN = true;
|
||||
bool disableIPv6 = false;
|
||||
bool disablePrefetch = false;
|
||||
int proxyType = nsIProtocolProxyService::PROXYCONFIG_DIRECT;
|
||||
@ -399,7 +397,6 @@ nsDNSService::Init()
|
||||
lifetimeGracePeriod = val / 60; // convert from seconds to minutes
|
||||
|
||||
// ASSUMPTION: pref branch does not modify out params on failure
|
||||
prefs->GetBoolPref(kPrefEnableIDN, &enableIDN);
|
||||
prefs->GetBoolPref(kPrefDisableIPv6, &disableIPv6);
|
||||
prefs->GetCharPref(kPrefIPv4OnlyDomains, getter_Copies(ipv4OnlyDomains));
|
||||
prefs->GetCharPref(kPrefDnsLocalDomains, getter_Copies(localDomains));
|
||||
@ -419,7 +416,6 @@ nsDNSService::Init()
|
||||
prefs->AddObserver(kPrefDnsCacheEntries, this, false);
|
||||
prefs->AddObserver(kPrefDnsCacheExpiration, this, false);
|
||||
prefs->AddObserver(kPrefDnsCacheGrace, this, false);
|
||||
prefs->AddObserver(kPrefEnableIDN, this, false);
|
||||
prefs->AddObserver(kPrefIPv4OnlyDomains, this, false);
|
||||
prefs->AddObserver(kPrefDnsLocalDomains, this, false);
|
||||
prefs->AddObserver(kPrefDisableIPv6, this, false);
|
||||
@ -431,12 +427,6 @@ nsDNSService::Init()
|
||||
}
|
||||
}
|
||||
|
||||
// we have to null out mIDN since we might be getting re-initialized
|
||||
// as a result of a pref change.
|
||||
nsCOMPtr<nsIIDNService> idn;
|
||||
if (enableIDN)
|
||||
idn = do_GetService(NS_IDNSERVICE_CONTRACTID);
|
||||
|
||||
nsDNSPrefetch::Initialize(this);
|
||||
|
||||
// Don't initialize the resolver if we're in offline mode.
|
||||
@ -444,6 +434,8 @@ nsDNSService::Init()
|
||||
if (gIOService->IsOffline() && !gIOService->IsComingOnline())
|
||||
return NS_OK;
|
||||
|
||||
nsCOMPtr<nsIIDNService> idn = do_GetService(NS_IDNSERVICE_CONTRACTID);
|
||||
|
||||
nsRefPtr<nsHostResolver> res;
|
||||
nsresult rv = nsHostResolver::Create(maxCacheEntries,
|
||||
maxCacheLifetime,
|
||||
|
@ -18,10 +18,6 @@ function round_trip(uri) {
|
||||
|
||||
var prefData =
|
||||
[
|
||||
{
|
||||
name: "network.enableIDN",
|
||||
newVal: true
|
||||
},
|
||||
{
|
||||
name: "network.IDN_show_punycode",
|
||||
newVal: false
|
||||
|
Loading…
Reference in New Issue
Block a user