Bug 1803371 - Part 1: Remove redundant ReadableStream::mAlgorithms r=smaug

ErrorCallback has surprisingly been broken as nothing currently set the algorithm with SetErrorAlgorithm. This patch removes the unused part, preparing another way in a child patch.

Differential Revision: https://phabricator.services.mozilla.com/D163691
This commit is contained in:
Kagami Sascha Rosylight 2022-12-06 18:37:27 +00:00
Родитель daf93c6f25
Коммит c19da7d46d
2 изменённых файлов: 3 добавлений и 21 удалений

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

@ -70,11 +70,9 @@ inline void ImplCycleCollectionUnlink(
namespace mozilla::dom {
// Only needed for refcounted objects.
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_WITH_JS_MEMBERS(ReadableStream,
(mGlobal, mController,
mReader, mAlgorithms,
mNativeUnderlyingSource),
(mStoredError))
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_WITH_JS_MEMBERS(
ReadableStream, (mGlobal, mController, mReader, mNativeUnderlyingSource),
(mStoredError))
NS_IMPL_CYCLE_COLLECTING_ADDREF(ReadableStream)
NS_IMPL_CYCLE_COLLECTING_RELEASE(ReadableStream)
@ -146,8 +144,6 @@ void ReadableStream::SetNativeUnderlyingSource(
void ReadableStream::ReleaseObjects() {
SetNativeUnderlyingSource(nullptr);
SetErrorAlgorithm(nullptr);
if (mController->IsByte()) {
ReadableByteStreamControllerClearAlgorithms(mController->AsByte());
return;
@ -610,12 +606,6 @@ void ReadableStreamError(JSContext* aCx, ReadableStream* aStream,
return;
}
}
// Not in Specification: Allow notifying native underlying sources that a
// stream has been errored.
if (UnderlyingSourceAlgorithmsBase* algorithms = aStream->GetAlgorithms()) {
algorithms->ErrorCallback();
}
}
// https://streams.spec.whatwg.org/#rs-default-controller-close

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

@ -84,11 +84,6 @@ class ReadableStream : public nsISupports, public nsWrapperCache {
mStoredError = aStoredError;
}
UnderlyingSourceAlgorithmsBase* GetAlgorithms() const { return mAlgorithms; }
void SetErrorAlgorithm(UnderlyingSourceAlgorithmsBase* aAlgorithms) {
mAlgorithms = aAlgorithms;
}
void SetNativeUnderlyingSource(BodyStreamHolder* aUnderlyingSource);
BodyStreamHolder* GetNativeUnderlyingSource() {
return mNativeUnderlyingSource;
@ -151,9 +146,6 @@ class ReadableStream : public nsISupports, public nsWrapperCache {
ReaderState mState = ReaderState::Readable;
JS::Heap<JS::Value> mStoredError;
// Optional Callback for erroring a stream.
RefPtr<UnderlyingSourceAlgorithmsBase> mAlgorithms;
// Optional strong reference to an Underlying Source; This
// exists because NativeUnderlyingSource callbacks don't hold
// a strong reference to the underlying source: So we need