Bug 1803386 - Part 2: Remove ReadableStream::ReleaseObjectsFromBodyStream r=smaug

No point to release a stream holder that is then nullified. Holding an empty holder is totally fine.

Differential Revision: https://phabricator.services.mozilla.com/D166534
This commit is contained in:
Kagami Sascha Rosylight 2023-01-12 13:43:59 +00:00
Родитель ac006ba3c4
Коммит 2ac5fcd132
4 изменённых файлов: 0 добавлений и 21 удалений

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

@ -598,11 +598,6 @@ void BodyStream::ReleaseObjects(const MutexSingleWriterAutoLock& aProofOfLock) {
} }
} }
ReadableStream* stream = mStreamHolder->GetReadableStreamBody();
if (stream) {
stream->ReleaseObjectsFromBodyStream();
}
mWorkerRef = nullptr; mWorkerRef = nullptr;
mGlobal = nullptr; mGlobal = nullptr;

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

@ -135,13 +135,6 @@ bool ReadableStreamHasDefaultReader(ReadableStream* aStream) {
return reader->IsDefault(); return reader->IsDefault();
} }
void ReadableStream::ReleaseObjectsFromBodyStream() {
// XXX(krosylight): Hacky way to workaround the ownership issue between
// BodyStream and ReadableStream trying to cleanup each other. See bug
// 1803386.
mController->ClearAlgorithmsWithoutRelease();
}
// Streams Spec: 4.2.4: https://streams.spec.whatwg.org/#rs-prototype // Streams Spec: 4.2.4: https://streams.spec.whatwg.org/#rs-prototype
/* static */ /* static */
already_AddRefed<ReadableStream> ReadableStream::Constructor( already_AddRefed<ReadableStream> ReadableStream::Constructor(

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

@ -94,10 +94,6 @@ class ReadableStream : public nsISupports, public nsWrapperCache {
return nullptr; return nullptr;
} }
// XXX(krosylight): BodyStream should really be a subclass of ReadableStream
// instead of owning ReadableStream this way. See bug 1803386.
void ReleaseObjectsFromBodyStream();
// [Transferable] // [Transferable]
// https://html.spec.whatwg.org/multipage/structured-data.html#transfer-steps // https://html.spec.whatwg.org/multipage/structured-data.html#transfer-steps
MOZ_CAN_RUN_SCRIPT bool Transfer(JSContext* aCx, MOZ_CAN_RUN_SCRIPT bool Transfer(JSContext* aCx,

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

@ -53,11 +53,6 @@ class ReadableStreamController : public nsISupports {
mAlgorithms = nullptr; mAlgorithms = nullptr;
} }
// XXX(krosylight): Hacky way to workaround the ownership issue between
// BodyStream and ReadableStream trying to cleanup each other. See bug
// 1803386.
void ClearAlgorithmsWithoutRelease() { mAlgorithms = nullptr; }
protected: protected:
nsCOMPtr<nsIGlobalObject> mGlobal; nsCOMPtr<nsIGlobalObject> mGlobal;