Backed out changeset 3b51e6804554 (bug 1747261) for causing xpcshell failures on test_E10SUtils_workers_remote_types.js. CLOSED TREE

This commit is contained in:
Marian-Vasile Laza 2022-01-04 21:42:15 +02:00
parent f41ea831f5
commit 8ae92912a3
2 changed files with 22 additions and 1 deletions

View File

@ -1427,6 +1427,14 @@
value: true
mirror: always
# Temporary pref which makes certain ServiceWorkers be isolated in special
# processes instead of within a the normal web/webIsolated process based on
# the URI. Entries are separated by commas
- name: browser.tabs.remote.serviceWorkerIsolationList
type: String
value: ""
mirror: never
# When this pref is enabled, opaque response is only allowed to enter the
# content process if it's a response for media (audio, image, video), CSS, or
# JavaScript.

View File

@ -44,6 +44,16 @@ XPCOMUtils.defineLazyPreferenceGetter(
"browser.tabs.remote.useCrossOriginOpenerPolicy",
false
);
// Preference containing the list (comma separated) of origins that will
// have ServiceWorkers isolated in special processes
XPCOMUtils.defineLazyPreferenceGetter(
this,
"serviceWorkerIsolationList",
"browser.tabs.remote.serviceWorkerIsolationList",
"",
false,
val => val.split(",")
);
XPCOMUtils.defineLazyServiceGetter(
this,
"serializationHelper",
@ -237,7 +247,10 @@ function validatedWebRemoteType(
if (
aIsWorker &&
aWorkerType === Ci.nsIE10SUtils.REMOTE_WORKER_TYPE_SERVICE
aWorkerType === Ci.nsIE10SUtils.REMOTE_WORKER_TYPE_SERVICE &&
serviceWorkerIsolationList.some(function(val) {
return targetPrincipal.siteOriginNoSuffix == val;
})
) {
return `${SERVICEWORKER_REMOTE_TYPE}=${targetPrincipal.siteOrigin}`;
}