Bug 1522136 - Remove javascript.options.streams and other legacy prefs. r=mgaudet,webidl,edgar

Differential Revision: https://phabricator.services.mozilla.com/D145810
This commit is contained in:
Tom Schuster 2022-05-13 18:58:48 +00:00
parent dbf185ac34
commit c256578f28
17 changed files with 23 additions and 94 deletions

View File

@ -141,7 +141,6 @@ add_task(async function interruptedDownloads() {
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.testing.enabled", true],
["javascript.options.streams", true],
],
});

View File

@ -68,7 +68,6 @@
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
["javascript.options.streams", true],
]}, runTest);
</script>
</pre>

View File

@ -82,7 +82,6 @@
["dom.serviceWorkers.exemptFromPerDomainMax", true],
["dom.serviceWorkers.enabled", true],
["dom.serviceWorkers.testing.enabled", true],
["javascript.options.streams", true],
["network.cookie.cookieBehavior", COOKIE_BEHAVIOR_REJECTFOREIGN],
]}, runTest);
</script>

View File

@ -44,8 +44,6 @@ support-files =
!/dom/security/test/csp/file_redirects_resource.sjs
!/dom/base/test/referrer_helper.js
!/dom/base/test/referrer_testserver.sjs
prefs =
javascript.options.streams=true
[test_headers.html]
[test_headers_sw_reroute.html]
[test_headers_mainthread.html]

View File

@ -42,7 +42,7 @@ Response includes Body;
// This should be part of Body but we don't want to expose body to request yet.
// See bug 1387483.
partial interface Response {
[GetterThrows, Pref="javascript.options.streams"]
[GetterThrows]
readonly attribute ReadableStream? body;
};

View File

@ -34,32 +34,28 @@ function workerCode() {
}
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set": [
["javascript.options.streams", true],
]}).then(() => {
const b = new Blob([workerCode+'workerCode();']);
const url = URL.createObjectURL(b);
const w = new Worker(url);
w.onmessage = function(e) {
ok(true, 'Worker is reading');
const wdm = Cc["@mozilla.org/dom/workers/workerdebuggermanager;1"].
getService(Ci.nsIWorkerDebuggerManager);
wdm.addListener({
onUnregister (dbg) {
if (dbg.url == url) {
ok(true, "Debugger with url " + url + " should be unregistered.");
wdm.removeListener(this);
SimpleTest.finish();
}
const b = new Blob([workerCode+'workerCode();']);
const url = URL.createObjectURL(b);
const w = new Worker(url);
w.onmessage = function(e) {
ok(true, 'Worker is reading');
const wdm = Cc["@mozilla.org/dom/workers/workerdebuggermanager;1"].
getService(Ci.nsIWorkerDebuggerManager);
wdm.addListener({
onUnregister (dbg) {
if (dbg.url == url) {
ok(true, "Debugger with url " + url + " should be unregistered.");
wdm.removeListener(this);
SimpleTest.finish();
}
});
w.terminate();
}
w.postMessage("start");
});
}
});
w.terminate();
}
w.postMessage("start");
</script>
</body>
</html>

View File

@ -182,30 +182,6 @@ class JS_PUBLIC_API RealmCreationOptions {
return *this;
}
bool getReadableByteStreamsEnabled() const { return readableByteStreams_; }
RealmCreationOptions& setReadableByteStreamsEnabled(bool flag) {
readableByteStreams_ = flag;
return *this;
}
bool getBYOBStreamReadersEnabled() const { return byobStreamReaders_; }
RealmCreationOptions& setBYOBStreamReadersEnabled(bool enabled) {
byobStreamReaders_ = enabled;
return *this;
}
bool getWritableStreamsEnabled() const { return writableStreams_; }
RealmCreationOptions& setWritableStreamsEnabled(bool enabled) {
writableStreams_ = enabled;
return *this;
}
bool getReadableStreamPipeToEnabled() const { return readableStreamPipeTo_; }
RealmCreationOptions& setReadableStreamPipeToEnabled(bool enabled) {
readableStreamPipeTo_ = enabled;
return *this;
}
WeakRefSpecifier getWeakRefsEnabled() const { return weakRefs_; }
RealmCreationOptions& setWeakRefsEnabled(WeakRefSpecifier spec) {
weakRefs_ = spec;
@ -279,10 +255,6 @@ class JS_PUBLIC_API RealmCreationOptions {
bool defineSharedArrayBufferConstructor_ = true;
bool coopAndCoep_ = false;
bool streams_ = false;
bool readableByteStreams_ = false;
bool byobStreamReaders_ = false;
bool writableStreams_ = false;
bool readableStreamPipeTo_ = false;
bool toSource_ = false;
bool propertyErrorMessageFix_ = false;
bool iteratorHelpers_ = false;

View File

@ -622,8 +622,6 @@ bool shell::enableSourcePragmas = true;
bool shell::enableAsyncStacks = false;
bool shell::enableAsyncStackCaptureDebuggeeOnly = false;
bool shell::enableStreams = false;
bool shell::enableReadableByteStreams = false;
bool shell::enableBYOBStreamReaders = false;
bool shell::enableWeakRefs = false;
bool shell::enableToSource = false;
bool shell::enablePropertyErrorMessageFix = false;
@ -4241,8 +4239,6 @@ static void SetStandardRealmOptions(JS::RealmOptions& options) {
.setSharedMemoryAndAtomicsEnabled(enableSharedMemory)
.setCoopAndCoepEnabled(false)
.setStreamsEnabled(enableStreams)
.setReadableByteStreamsEnabled(enableReadableByteStreams)
.setBYOBStreamReadersEnabled(enableBYOBStreamReaders)
.setWeakRefsEnabled(enableWeakRefs
? JS::WeakRefSpecifier::EnabledWithCleanupSome
: JS::WeakRefSpecifier::Disabled)
@ -11026,8 +11022,6 @@ static bool SetContextOptions(JSContext* cx, const OptionParser& op) {
enableAsyncStackCaptureDebuggeeOnly =
op.getBoolOption("async-stacks-capture-debuggee-only");
enableStreams = !op.getBoolOption("no-streams");
enableReadableByteStreams = op.getBoolOption("enable-readable-byte-streams");
enableBYOBStreamReaders = op.getBoolOption("enable-byob-stream-readers");
enableWeakRefs = !op.getBoolOption("disable-weak-refs");
enableToSource = !op.getBoolOption("disable-tosource");
enablePropertyErrorMessageFix =
@ -12007,12 +12001,6 @@ int main(int argc, char** argv) {
!op.addBoolOption('\0', "enable-streams",
"Enable WHATWG Streams (default)") ||
!op.addBoolOption('\0', "no-streams", "Disable WHATWG Streams") ||
!op.addBoolOption('\0', "enable-readable-byte-streams",
"Enable support for WHATWG ReadableStreams of type "
"'bytes'") ||
!op.addBoolOption('\0', "enable-byob-stream-readers",
"Enable support for getting BYOB readers for WHATWG "
"ReadableStreams of type \"bytes\"") ||
!op.addBoolOption('\0', "disable-weak-refs", "Disable weak references") ||
!op.addBoolOption('\0', "disable-tosource", "Disable toSource/uneval") ||
!op.addBoolOption('\0', "disable-property-error-message-fix",

View File

@ -797,8 +797,6 @@ void xpc::SetPrefableRealmOptions(JS::RealmOptions& options) {
.setCoopAndCoepEnabled(
StaticPrefs::browser_tabs_remote_useCrossOriginOpenerPolicy() &&
StaticPrefs::browser_tabs_remote_useCrossOriginEmbedderPolicy())
.setWritableStreamsEnabled(
StaticPrefs::javascript_options_writable_streams())
.setPropertyErrorMessageFixEnabled(sPropertyErrorMessageFixEnabled)
.setWeakRefsEnabled(GetWeakRefsEnabled())
.setIteratorHelpersEnabled(sIteratorHelpersEnabled)

View File

@ -6756,22 +6756,6 @@
mirror: always # LoadStartupJSPrefs
do_not_use_directly: true
# Streams API. This only applies to JS Streams
- name: javascript.options.streams
type: RelaxedAtomicBool
value: true
mirror: always
# Writable Streams API. (The pref above must also be set to expose this.)
#
# Writable streams are still EXTRAORDINARILY BETA and it is well-known that
# things are likely pretty broken if you poke much at all, so if you flip this
# preference, don't report bugs against it just yet.
- name: javascript.options.writable_streams
type: RelaxedAtomicBool
value: false
mirror: always
- name: javascript.options.main_thread_stack_quota_cap
type: uint32_t
#if defined(MOZ_ASAN)

View File

@ -1,3 +1,2 @@
prefs: [javascript.options.streams:true]
lsan-disabled: true
leak-threshold: [default:51200]

View File

@ -1,3 +1,2 @@
prefs: [javascript.options.streams:true]
lsan-disabled: true
leak-threshold: [default:3020800]

View File

@ -1,2 +1 @@
prefs: [javascript.options.streams:true]
lsan-allowed: [Alloc, NS_NewCStringInputStream, PR_NewMonitor, maybe_pod_malloc, mozilla::NonBlockingAsyncInputStream::AsyncWait, mozilla::NonBlockingAsyncInputStream::Create, mozilla::dom::BodyStream::Create, mozilla::dom::WorkerPrivate::WorkerPrivate, unknown stack]

View File

@ -1,3 +1,3 @@
prefs: [javascript.options.streams:true, dom.serviceWorkers.mitigations.bypass_on_fault:false]
prefs: [dom.serviceWorkers.mitigations.bypass_on_fault:false]
lsan-allowed: [Alloc, MakeUnique, Malloc, mozilla::detail::UniqueSelector, mozilla::dom::ClientManager::CreateSourceInternal, mozilla::dom::ClientManager::GetOrCreateForCurrentThread, mozilla::dom::Performance::CreateForWorker, mozilla::dom::PerformanceStorageWorker::AddEntryOnWorker, mozilla::dom::ServiceWorkerGlobalScope::GetClients, mozilla::dom::ServiceWorkerRegistration::CreateForWorker, mozilla::dom::WorkerLocation::Create, mozilla::dom::WorkerNavigator::Create, mozilla::dom::WorkerPrivate::GetOrCreateGlobalScope, mozilla::dom::cache::CacheStorage::CreateOnWorker, nsDynamicAtom::Create]
leak-threshold: [tab:51200]

View File

@ -1 +1 @@
prefs: [javascript.options.streams:true, dom.streams.transform_streams.enabled:true, dom.streams.pipeTo.enabled:true]
prefs: [dom.streams.transform_streams.enabled:true, dom.streams.pipeTo.enabled:true]

View File

@ -1 +0,0 @@
prefs: [javascript.options.streams:true]

View File

@ -1,3 +1,3 @@
prefs: [javascript.options.streams:true, dom.xhr.standard_content_type_normalization:true]
prefs: [dom.xhr.standard_content_type_normalization:true]
lsan-allowed: [Alloc, mozilla::net::AddStaticElement, mozilla::net::nsServerSocket::CreateClientTransport]
leak-threshold: [default:51200]