Bug 1878001 - Add bypass list for DefaultURI fallback r=necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D200323
This commit is contained in:
edgul
2024-04-04 14:13:58 +00:00
parent f8ee70f7ac
commit bdc96ff6f1
8 changed files with 151 additions and 0 deletions

View File

@@ -87,6 +87,7 @@ using mozilla::dom::ServiceWorkerDescriptor;
#define WEBRTC_PREF_PREFIX "media.peerconnection."
#define NETWORK_DNS_PREF "network.dns."
#define FORCE_EXTERNAL_PREF_PREFIX "network.protocol-handler.external."
#define SIMPLE_URI_SCHEMES_PREF "network.url.simple_uri_schemes"
nsIOService* gIOService;
static bool gHasWarnedUploadChannel2;
@@ -211,6 +212,7 @@ static const char* gCallbackPrefs[] = {
NECKO_BUFFER_CACHE_SIZE_PREF,
NETWORK_CAPTIVE_PORTAL_PREF,
FORCE_EXTERNAL_PREF_PREFIX,
SIMPLE_URI_SCHEMES_PREF,
nullptr,
};
@@ -1528,6 +1530,15 @@ void nsIOService::PrefsChanged(const char* pref) {
AutoWriteLock lock(mLock);
mForceExternalSchemes = std::move(forceExternalSchemes);
}
if (!pref || strncmp(pref, SIMPLE_URI_SCHEMES_PREF,
strlen(SIMPLE_URI_SCHEMES_PREF)) == 0) {
LOG((
"simple_uri_schemes pref change observed, updating the scheme list\n"));
nsAutoCString schemeList;
Preferences::GetCString(SIMPLE_URI_SCHEMES_PREF, schemeList);
mozilla::net::ParseSimpleURISchemes(schemeList);
}
}
void nsIOService::ParsePortList(const char* pref, bool remove) {