/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim:set ts=2 sw=2 sts=2 et cindent: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
class Promise; class ReadableStreamBYOBRequest; class ReadableStreamDefaultReader; class ReadableStreamGenericReader; struct ReadableStreamGetReaderOptions; struct ReadableStreamIteratorOptions; struct ReadIntoRequest; class WritableStream; struct ReadableWritablePair; struct StreamPipeOptions;
using ReadableStreamReader =
ReadableStreamDefaultReaderOrReadableStreamBYOBReader; using OwningReadableStreamReader =
OwningReadableStreamDefaultReaderOrReadableStreamBYOBReader; class NativeUnderlyingSource; class BodyStreamHolder; class UniqueMessagePortId; class MessagePort;
class ReadableStream : public nsISupports, public nsWrapperCache { public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(ReadableStream)
friendclass WritableStream;
protected: virtual ~ReadableStream();
nsCOMPtr<nsIGlobalObject> mGlobal;
// If one extends ReadableStream with another cycle collectable class, // calling HoldJSObjects and DropJSObjects should happen using 'this' of // that extending class. And in that case Explicit should be passed to the // constructor of ReadableStream so that it doesn't make those calls. // See also https://bugzilla.mozilla.org/show_bug.cgi?id=1801214. enumclass HoldDropJSObjectsCaller { Implicit, Explicit };
protected: // Sets up the ReadableStream with byte reading support. Intended for // subclasses. void SetUpByteNative(JSContext* aCx,
UnderlyingSourceAlgorithmsWrapper& aAlgorithms,
mozilla::Maybe<double> aHighWaterMark, ErrorResult& aRv);
public: // Creates and sets up a ReadableStream with byte reading support. Use // SetUpByteNative for this purpose in subclasses. static already_AddRefed<ReadableStream> CreateByteNative(
JSContext* aCx, nsIGlobalObject* aGlobal,
UnderlyingSourceAlgorithmsWrapper& aAlgorithms,
mozilla::Maybe<double> aHighWaterMark, ErrorResult& aRv);
// The following algorithms must only be used on ReadableStream instances // initialized via the above set up or set up with byte reading support // algorithms (not, e.g., on web-developer-created instances):
// The following algorithms can be used on arbitrary ReadableStream instances, // including ones that are created by web developers. They can all fail in // various operation-specific ways, and these failures should be handled by // the calling specification.
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.