Skip to content

Commit

Permalink
Backed out changeset 21d7dfa0dfee (bug 1734241) for causing bp-hybrid…
Browse files Browse the repository at this point in the history
… bustages on ReadableStreamPipeTo.cpp. CLOSED TREE
  • Loading branch information
Iulian Moraru committed Feb 18, 2022
1 parent 469e3fe commit 9807ab4
Show file tree
Hide file tree
Showing 24 changed files with 2,227 additions and 1,100 deletions.
34 changes: 0 additions & 34 deletions dom/streams/ReadableStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,13 @@
#include "mozilla/dom/ReadableStreamController.h"
#include "mozilla/dom/ReadableStreamDefaultController.h"
#include "mozilla/dom/ReadableStreamDefaultReader.h"
#include "mozilla/dom/ReadableStreamPipeTo.h"
#include "mozilla/dom/ReadableStreamTee.h"
#include "mozilla/dom/RootedDictionary.h"
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/dom/StreamUtils.h"
#include "mozilla/dom/TeeState.h"
#include "mozilla/dom/UnderlyingSourceBinding.h"
#include "mozilla/dom/UnderlyingSourceCallbackHelpers.h"
#include "mozilla/dom/WritableStream.h"
#include "mozilla/dom/WritableStreamDefaultWriter.h"
#include "nsCOMPtr.h"

#include "mozilla/dom/Promise-inl.h"
Expand Down Expand Up @@ -849,37 +846,6 @@ static void ReadableStreamDefaultTee(JSContext* aCx, ReadableStream* aStream,
aResult.AppendElement(teeState->Branch2());
}

// https://streams.spec.whatwg.org/#rs-pipe-to
already_AddRefed<Promise> ReadableStream::PipeTo(
WritableStream& aDestination, const StreamPipeOptions& aOptions,
ErrorResult& aRv) {
// Step 1. If !IsReadableStreamLocked(this) is true, return a promise rejected
// with a TypeError exception.
if (IsReadableStreamLocked(this)) {
aRv.ThrowTypeError("Cannot pipe from a locked stream.");
return nullptr;
}

// Step 2. If !IsWritableStreamLocked(destination) is true, return a promise
// rejected with a TypeError exception.
if (IsWritableStreamLocked(&aDestination)) {
aRv.ThrowTypeError("Can not pipe to a locked stream.");
return nullptr;
}

// Step 3. Let signal be options["signal"] if it exists, or undefined
// otherwise.
RefPtr<AbortSignal> signal =
aOptions.mSignal.WasPassed() ? &aOptions.mSignal.Value() : nullptr;

// Step 4. Return ! ReadableStreamPipeTo(this, destination,
// options["preventClose"], options["preventAbort"], options["preventCancel"],
// signal).
return ReadableStreamPipeTo(this, &aDestination, aOptions.mPreventClose,
aOptions.mPreventAbort, aOptions.mPreventCancel,
signal, aRv);
}

// https://streams.spec.whatwg.org/#readable-stream-tee
MOZ_CAN_RUN_SCRIPT
static void ReadableStreamTee(JSContext* aCx, ReadableStream* aStream,
Expand Down
6 changes: 0 additions & 6 deletions dom/streams/ReadableStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/QueuingStrategyBinding.h"
#include "mozilla/dom/ReadableStreamController.h"
#include "mozilla/dom/ReadableStreamBinding.h"
#include "mozilla/dom/ReadableStreamDefaultController.h"
#include "nsCycleCollectionParticipant.h"
#include "nsWrapperCache.h"
Expand All @@ -32,7 +31,6 @@ class ReadableStreamDefaultReader;
class ReadableStreamGenericReader;
struct ReadableStreamGetReaderOptions;
struct ReadIntoRequest;
class WritableStream;

using ReadableStreamReader =
ReadableStreamDefaultReaderOrReadableStreamBYOBReader;
Expand Down Expand Up @@ -124,10 +122,6 @@ class ReadableStream final : public nsISupports, public nsWrapperCache {
void GetReader(JSContext* aCx, const ReadableStreamGetReaderOptions& aOptions,
OwningReadableStreamReader& resultReader, ErrorResult& aRv);

MOZ_CAN_RUN_SCRIPT already_AddRefed<Promise> PipeTo(
WritableStream& aDestinaton, const StreamPipeOptions& aOptions,
ErrorResult& aRv);

MOZ_CAN_RUN_SCRIPT void Tee(JSContext* aCx,
nsTArray<RefPtr<ReadableStream>>& aResult,
ErrorResult& aRv);
Expand Down
Loading

0 comments on commit 9807ab4

Please sign in to comment.