/* -*- 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 WritableStreamDefaultController; class WritableStreamDefaultWriter; class UnderlyingSinkAlgorithmsBase; class UniqueMessagePortId; class MessagePort;
class WritableStream : public nsISupports, public nsWrapperCache { public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(WritableStream)
friendclass ReadableStream;
protected: virtual ~WritableStream();
virtualvoid LastRelease() {}
// If one extends WritableStream 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 WriteableStream so that it doesn't make those calls. // See also https://bugzilla.mozilla.org/show_bug.cgi?id=1801214. enumclass HoldDropJSObjectsCaller { Implicit, Explicit };
// https://streams.spec.whatwg.org/#writablestream-set-up protected: // Sets up the WritableStream. Intended for subclasses. void SetUpNative(JSContext* aCx, UnderlyingSinkAlgorithmsWrapper& aAlgorithms,
Maybe<double> aHighWaterMark,
QueuingStrategySize* aSizeAlgorithm, ErrorResult& aRv);
public: // Creates and sets up a WritableStream. Use SetUpNative for this purpose in // subclasses. static already_AddRefed<WritableStream> CreateNative(
JSContext* aCx, nsIGlobalObject& aGlobal,
UnderlyingSinkAlgorithmsWrapper& aAlgorithms,
Maybe<double> aHighWaterMark, QueuingStrategySize* aSizeAlgorithm,
ErrorResult& aRv);
// The following definitions must only be used on WritableStream instances // initialized via the above set up algorithm:
// We inline all members of [[pendingAbortRequest]] in this class. // The absence (i.e. undefined) of the [[pendingAbortRequest]] // is indicated by mPendingAbortRequestPromise = nullptr.
RefPtr<Promise> mPendingAbortRequestPromise;
JS::Heap<JS::Value> mPendingAbortRequestReason; bool mPendingAbortRequestWasAlreadyErroring = false;
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.