зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
daf93c6f25
Коммит
c19da7d46d
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче