зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1734174 - Remove unneeded JSContext parameter from AcquireReadableStreamDefaultReader() r=mgaudet
Depends on D139871 Differential Revision: https://phabricator.services.mozilla.com/D139872
This commit is contained in:
Родитель
d642cee2f5
Коммит
44b065fd5a
|
@ -1570,7 +1570,7 @@ void FetchBody<Derived>::LockStream(JSContext* aCx, ReadableStream* aStream,
|
|||
ErrorResult& aRv) {
|
||||
// This is native stream, creating a reader will not execute any JS code.
|
||||
RefPtr<ReadableStreamDefaultReader> reader =
|
||||
AcquireReadableStreamDefaultReader(aCx, aStream, aRv);
|
||||
AcquireReadableStreamDefaultReader(aStream, aRv);
|
||||
if (aRv.Failed()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -198,7 +198,7 @@ void FetchStreamReader::StartConsuming(JSContext* aCx, ReadableStream* aStream,
|
|||
MOZ_DIAGNOSTIC_ASSERT(aStream);
|
||||
|
||||
RefPtr<ReadableStreamDefaultReader> reader =
|
||||
AcquireReadableStreamDefaultReader(aCx, aStream, aRv);
|
||||
AcquireReadableStreamDefaultReader(aStream, aRv);
|
||||
if (aRv.Failed()) {
|
||||
CloseAndRelease(aCx, NS_ERROR_DOM_INVALID_STATE_ERR);
|
||||
return;
|
||||
|
|
|
@ -462,8 +462,7 @@ already_AddRefed<Promise> ReadableStream::Cancel(JSContext* aCx,
|
|||
|
||||
// https://streams.spec.whatwg.org/#acquire-readable-stream-reader
|
||||
already_AddRefed<ReadableStreamDefaultReader>
|
||||
AcquireReadableStreamDefaultReader(JSContext* aCx, ReadableStream* aStream,
|
||||
ErrorResult& aRv) {
|
||||
AcquireReadableStreamDefaultReader(ReadableStream* aStream, ErrorResult& aRv) {
|
||||
// Step 1.
|
||||
RefPtr<ReadableStreamDefaultReader> reader =
|
||||
new ReadableStreamDefaultReader(aStream->GetParentObject());
|
||||
|
@ -488,7 +487,7 @@ void ReadableStream::GetReader(JSContext* aCx,
|
|||
if (!aOptions.mMode.WasPassed()) {
|
||||
RefPtr<ReadableStream> thisRefPtr = this;
|
||||
RefPtr<ReadableStreamDefaultReader> defaultReader =
|
||||
AcquireReadableStreamDefaultReader(aCx, thisRefPtr, aRv);
|
||||
AcquireReadableStreamDefaultReader(thisRefPtr, aRv);
|
||||
if (aRv.Failed()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -188,8 +188,7 @@ MOZ_CAN_RUN_SCRIPT extern already_AddRefed<Promise> ReadableStreamCancel(
|
|||
ErrorResult& aRv);
|
||||
|
||||
extern already_AddRefed<ReadableStreamDefaultReader>
|
||||
AcquireReadableStreamDefaultReader(JSContext* aCx, ReadableStream* aStream,
|
||||
ErrorResult& aRv);
|
||||
AcquireReadableStreamDefaultReader(ReadableStream* aStream, ErrorResult& aRv);
|
||||
|
||||
extern bool ReadableStreamHasBYOBReader(ReadableStream* aStream);
|
||||
extern bool ReadableStreamHasDefaultReader(ReadableStream* aStream);
|
||||
|
|
|
@ -815,7 +815,7 @@ already_AddRefed<Promise> ReadableStreamPipeTo(
|
|||
// Note: In the interests of simplicity, we choose here to always acquire
|
||||
// a default reader.
|
||||
RefPtr<ReadableStreamDefaultReader> reader =
|
||||
AcquireReadableStreamDefaultReader(cx, aSource, aRv);
|
||||
AcquireReadableStreamDefaultReader(aSource, aRv);
|
||||
if (aRv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -582,8 +582,7 @@ void PullWithDefaultReader(JSContext* aCx, TeeState* aTeeState,
|
|||
}
|
||||
|
||||
// Step 15.1.3. Set reader to ! AcquireReadableStreamDefaultReader(stream).
|
||||
reader =
|
||||
AcquireReadableStreamDefaultReader(aCx, aTeeState->GetStream(), aRv);
|
||||
reader = AcquireReadableStreamDefaultReader(aTeeState->GetStream(), aRv);
|
||||
if (aRv.Failed()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ already_AddRefed<TeeState> TeeState::Create(JSContext* aCx,
|
|||
RefPtr<TeeState> teeState = new TeeState(aCx, aStream, aCloneForBranch2);
|
||||
|
||||
RefPtr<ReadableStreamDefaultReader> reader =
|
||||
AcquireReadableStreamDefaultReader(aCx, teeState->GetStream(), aRv);
|
||||
AcquireReadableStreamDefaultReader(teeState->GetStream(), aRv);
|
||||
if (aRv.Failed()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче