diff options
Diffstat (limited to 'js/src/builtin/streams/WritableStreamWriterOperations.h')
-rw-r--r-- | js/src/builtin/streams/WritableStreamWriterOperations.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/js/src/builtin/streams/WritableStreamWriterOperations.h b/js/src/builtin/streams/WritableStreamWriterOperations.h new file mode 100644 index 0000000000..241b166354 --- /dev/null +++ b/js/src/builtin/streams/WritableStreamWriterOperations.h @@ -0,0 +1,56 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- + * vim: set ts=8 sts=2 et sw=2 tw=80: + * 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/. */ + +/* Writable stream writer abstract operations. */ + +#ifndef builtin_streams_WritableStreamWriterOperations_h +#define builtin_streams_WritableStreamWriterOperations_h + +#include "mozilla/Attributes.h" // MOZ_MUST_USE + +#include "js/RootingAPI.h" // JS::{,Mutable}Handle +#include "js/Value.h" // JS::Value + +struct JS_PUBLIC_API JSContext; +class JS_PUBLIC_API JSObject; + +namespace js { + +class PromiseObject; +class WritableStreamDefaultWriter; + +extern JSObject* WritableStreamDefaultWriterAbort( + JSContext* cx, JS::Handle<WritableStreamDefaultWriter*> unwrappedWriter, + JS::Handle<JS::Value> reason); + +extern PromiseObject* WritableStreamDefaultWriterClose( + JSContext* cx, JS::Handle<WritableStreamDefaultWriter*> unwrappedWriter); + +extern PromiseObject* WritableStreamDefaultWriterCloseWithErrorPropagation( + JSContext* cx, JS::Handle<WritableStreamDefaultWriter*> unwrappedWriter); + +extern MOZ_MUST_USE bool WritableStreamDefaultWriterEnsureClosedPromiseRejected( + JSContext* cx, JS::Handle<WritableStreamDefaultWriter*> unwrappedWriter, + JS::Handle<JS::Value> error); + +extern MOZ_MUST_USE bool WritableStreamDefaultWriterEnsureReadyPromiseRejected( + JSContext* cx, JS::Handle<WritableStreamDefaultWriter*> unwrappedWriter, + JS::Handle<JS::Value> error); + +extern MOZ_MUST_USE bool WritableStreamDefaultWriterGetDesiredSize( + JSContext* cx, JS::Handle<WritableStreamDefaultWriter*> unwrappedWriter, + JS::MutableHandle<JS::Value> size); + +extern MOZ_MUST_USE bool WritableStreamDefaultWriterRelease( + JSContext* cx, JS::Handle<WritableStreamDefaultWriter*> unwrappedWriter); + +extern PromiseObject* WritableStreamDefaultWriterWrite( + JSContext* cx, JS::Handle<WritableStreamDefaultWriter*> unwrappedWriter, + JS::Handle<JS::Value> chunk); + +} // namespace js + +#endif // builtin_streams_WritableStreamWriterOperations_h |