Bug 1587394 - Provide a pref to bypass postMessage COOP and COEP check on Nightly and Dev; r=nika

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tom Tung 2019-10-17 14:15:58 +00:00
Родитель 7c0ea68b6d
Коммит 48bfc7dee9
4 изменённых файлов: 24 добавлений и 0 удалений

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

@ -2400,6 +2400,11 @@ void nsGlobalWindowInner::UpdateTopInnerWindow() {
bool nsGlobalWindowInner::CanShareMemory(const nsID& aAgentClusterId) {
MOZ_ASSERT(NS_IsMainThread());
if (StaticPrefs::
dom_postMessage_sharedArrayBuffer_bypassCOOP_COEP_insecure_enabled()) {
return true;
}
if (!StaticPrefs::dom_postMessage_sharedArrayBuffer_withCOOP_COEP()) {
return false;
}

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

@ -4970,6 +4970,11 @@ const nsAString& WorkerPrivate::Id() {
bool WorkerPrivate::CanShareMemory(const nsID& aAgentClusterId) {
AssertIsOnWorkerThread();
if (StaticPrefs::
dom_postMessage_sharedArrayBuffer_bypassCOOP_COEP_insecure_enabled()) {
return true;
}
if (!StaticPrefs::dom_postMessage_sharedArrayBuffer_withCOOP_COEP()) {
return false;
}

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

@ -1903,6 +1903,12 @@
value: false
mirror: always
# Overridden in all.js on RELEASE_OR_BETA in order to add the locked attribute.
- name: dom.postMessage.sharedArrayBuffer.bypassCOOP_COEP.insecure.enabled
type: RelaxedAtomicBool
value: false
mirror: always
# Presentation API
- name: dom.presentation.enabled
type: bool

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

@ -4935,3 +4935,11 @@ pref("devtools.devices.url", "https://code.cdn.mozilla.net/devices/devices.json"
// Enable Inactive CSS detection; used both by the client and the server.
pref("devtools.inspector.inactive.css.enabled", true);
#if defined(NIGHTLY_BUILD) || defined(MOZ_DEV_EDITION)
// Define in StaticPrefList.yaml and override here since StaticPrefList.yaml
// doesn't provide a way to lock the pref
pref("dom.postMessage.sharedArrayBuffer.bypassCOOP_COEP.insecure.enabled", false);
#else
pref("dom.postMessage.sharedArrayBuffer.bypassCOOP_COEP.insecure.enabled", false, locked);
#endif