summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Smith <brian@dbsoft.org>2023-10-02 04:42:24 -0500
committerBrian Smith <brian@dbsoft.org>2023-10-02 04:42:24 -0500
commitec38250eeadfbcd8b261f3e4f345a9c49d01fcb5 (patch)
treeb81625418c8fa14a9f6249da64fc992e9a5de5e7
parentb7a5d73ba9752ab9d9c62497997592b290f38a15 (diff)
downloaduxp-ec38250eeadfbcd8b261f3e4f345a9c49d01fcb5.tar.gz
Issue #1442 - Part 24 - Prevent FetchStream from incorrectly running on the main thread.
This prevents a deadlock and JSContext related crashes, however this should eventually be replaced by an EventTargetFor() call when the Dispatcher API is implemented. Also now that ReadableStream appears stable, toggle the preferences true by default.
-rw-r--r--dom/fetch/FetchStream.cpp4
-rw-r--r--modules/libpref/init/all.js4
2 files changed, 5 insertions, 3 deletions
diff --git a/dom/fetch/FetchStream.cpp b/dom/fetch/FetchStream.cpp
index 8d2ac7b1df..1c22a71405 100644
--- a/dom/fetch/FetchStream.cpp
+++ b/dom/fetch/FetchStream.cpp
@@ -403,7 +403,9 @@ FetchStream::FetchStream(nsIGlobalObject* aGlobal,
, mGlobal(aGlobal)
, mStreamHolder(aStreamHolder)
, mOriginalInputStream(aInputStream)
- , mOwningEventTarget(nullptr)
+ // TODO: Replace with mGlobal->EventTargetFor(TaskCategory::Other)
+ // When we have the Dispatcher API in the tree, see Issue #1442
+ , mOwningEventTarget(NS_GetCurrentThread())
{
MOZ_DIAGNOSTIC_ASSERT(aInputStream);
MOZ_DIAGNOSTIC_ASSERT(aStreamHolder);
diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js
index 6ae1e276a3..0f3fa7c85c 100644
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1302,7 +1302,7 @@ pref("javascript.options.main_thread_stack_quota_cap", 2097152);
pref("javascript.options.dynamicImport", true);
// Streams API
-pref("javascript.options.streams", false);
+pref("javascript.options.streams", true);
// advanced prefs
pref("advanced.mailftp", false);
@@ -4529,7 +4529,7 @@ pref("layout.animated-image-layers.enabled", false);
pref("dom.abortController.enabled", true);
// Streams API
-pref("dom.streams.enabled", false);
+pref("dom.streams.enabled", true);
// Push
pref("dom.push.enabled", false);