mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-14 04:03:47 +00:00
Bug 1880789 - Remove dom.workers.modules.enabled pref. r=gregp,webidl,dom-worker-reviewers,saschanaz,dom-storage-reviewers,janv,yulia,asuth
Differential Revision: https://phabricator.services.mozilla.com/D223065
This commit is contained in:
parent
c9d3172c3b
commit
e70bfc694a
@ -69,7 +69,6 @@ add_setup(async function () {
|
||||
const optionalPrefsToSet = [
|
||||
["dom.fs.enabled", true],
|
||||
["dom.fs.writable_file_stream.enabled", true],
|
||||
["dom.workers.modules.enabled", true],
|
||||
];
|
||||
|
||||
await setStoragePrefs(optionalPrefsToSet);
|
||||
|
@ -31,9 +31,7 @@ interface Worker : EventTarget {
|
||||
Worker includes AbstractWorker;
|
||||
|
||||
dictionary WorkerOptions {
|
||||
[Pref="dom.workers.modules.enabled"]
|
||||
WorkerType type = "classic";
|
||||
[Pref="dom.workers.modules.enabled"]
|
||||
RequestCredentials credentials = "same-origin"; // credentials is only used if type is "module"
|
||||
DOMString name = "";
|
||||
};
|
||||
|
@ -243,10 +243,6 @@ void LoadAllScripts(WorkerPrivate* aWorkerPrivate,
|
||||
// even if the debugged worker is a Module.
|
||||
if (aWorkerPrivate->WorkerType() == WorkerType::Module &&
|
||||
aWorkerScriptType != DebuggerScript) {
|
||||
if (!StaticPrefs::dom_workers_modules_enabled()) {
|
||||
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
return;
|
||||
}
|
||||
MOZ_ASSERT(aIsMainScript);
|
||||
// Module Load
|
||||
RefPtr<JS::loader::ScriptLoadRequest> mainScript = loader->GetMainScript();
|
||||
@ -515,10 +511,6 @@ already_AddRefed<WorkerScriptLoader> WorkerScriptLoader::Create(
|
||||
nsIGlobalObject* global = self->GetGlobal();
|
||||
self->mController = global->GetController();
|
||||
|
||||
if (!StaticPrefs::dom_workers_modules_enabled()) {
|
||||
return self.forget();
|
||||
}
|
||||
|
||||
// Set up the module loader, if it has not been initialzied yet.
|
||||
self->InitModuleLoader();
|
||||
|
||||
@ -701,10 +693,6 @@ already_AddRefed<ScriptLoadRequest> WorkerScriptLoader::CreateScriptLoadRequest(
|
||||
// implementation, so we are defaulting the fetchOptions object defined
|
||||
// above. This behavior is handled fully in GetModuleSecFlags.
|
||||
|
||||
if (!StaticPrefs::dom_workers_modules_enabled()) {
|
||||
mRv.ThrowTypeError("Modules in workers are currently disallowed.");
|
||||
return nullptr;
|
||||
}
|
||||
RefPtr<WorkerModuleLoader::ModuleLoaderBase> moduleLoader =
|
||||
GetGlobal()->GetModuleLoader(nullptr);
|
||||
|
||||
@ -1256,8 +1244,7 @@ bool WorkerScriptLoader::EvaluateScript(JSContext* aCx,
|
||||
}
|
||||
|
||||
RefPtr<JS::loader::ClassicScript> classicScript = nullptr;
|
||||
if (StaticPrefs::dom_workers_modules_enabled() &&
|
||||
!mWorkerRef->Private()->IsServiceWorker()) {
|
||||
if (!mWorkerRef->Private()->IsServiceWorker()) {
|
||||
// We need a LoadedScript to be associated with the JSScript in order to
|
||||
// correctly resolve the referencing private for dynamic imports. In turn
|
||||
// this allows us to correctly resolve the BaseURL.
|
||||
|
@ -23,9 +23,6 @@ Worker Import failure test: Bug 1824498
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
document.addEventListener("DOMContentLoaded", async () => {
|
||||
await SpecialPowers.pushPrefEnv(
|
||||
{ set: [["dom.workers.modules.enabled", true ]] });
|
||||
|
||||
const worker = new Worker("worker_bug1824498.mjs", {"type": "module"})
|
||||
worker.onerror = function(event) {
|
||||
ok(true, "not assert");
|
||||
|
@ -26,8 +26,6 @@ done by dynamic import
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
async function onLoad() {
|
||||
await SpecialPowers.pushPrefEnv(
|
||||
{ set: [["dom.workers.modules.enabled", true ]] });
|
||||
|
||||
const workers = [
|
||||
new Worker("dynamicImport_worker.js", {type: "classic"}),
|
||||
|
@ -25,9 +25,6 @@ Ensure that the script loader doesn't fail if requests are terminated early.
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
async function onLoad() {
|
||||
await SpecialPowers.pushPrefEnv(
|
||||
{ set: [["dom.workers.modules.enabled", true ]] });
|
||||
|
||||
const workers = [
|
||||
new Worker("dynamicImport_worker.js", {type: "classic"}),
|
||||
new Worker("dynamicImport_worker.js", {type: "module"})
|
||||
|
@ -4131,12 +4131,6 @@
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
# Is support for modules (new Worker(..., {type: "module"})) enabled for workers?
|
||||
- name: dom.workers.modules.enabled
|
||||
type: RelaxedAtomicBool
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
- name: dom.workers.throttling.enabled
|
||||
type: RelaxedAtomicBool
|
||||
value: false
|
||||
|
Loading…
x
Reference in New Issue
Block a user