#include "third_party/blink/renderer/core/streams/writable_stream_default_writer.h"
#include "third_party/blink/renderer/bindings/core/v8/script_value.h"
#include "third_party/blink/renderer/core/streams/miscellaneous_operations.h"
#include "third_party/blink/renderer/core/streams/writable_stream.h"
#include "third_party/blink/renderer/core/streams/writable_stream_default_controller.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
#include "third_party/blink/renderer/platform/bindings/v8_binding.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
namespace blink {
namespace {
String CreateWriterLockReleasedMessage(const char* verbed) { … }
v8::Local<v8::Value> CreateWriterLockReleasedException(v8::Isolate* isolate,
const char* verbed) { … }
}
WritableStreamDefaultWriter* WritableStreamDefaultWriter::Create(
ScriptState* script_state,
WritableStream* stream,
ExceptionState& exception_state) { … }
WritableStreamDefaultWriter::WritableStreamDefaultWriter(
ScriptState* script_state,
WritableStream* stream,
ExceptionState& exception_state)
: … { … }
WritableStreamDefaultWriter::~WritableStreamDefaultWriter() = default;
ScriptPromise<IDLUndefined> WritableStreamDefaultWriter::closed(
ScriptState* script_state) const { … }
ScriptValue WritableStreamDefaultWriter::desiredSize(
ScriptState* script_state,
ExceptionState& exception_state) const { … }
ScriptPromise<IDLUndefined> WritableStreamDefaultWriter::ready(
ScriptState* script_state) const { … }
ScriptPromise<IDLUndefined> WritableStreamDefaultWriter::abort(
ScriptState* script_state,
ExceptionState& exception_state) { … }
ScriptPromise<IDLUndefined> WritableStreamDefaultWriter::abort(
ScriptState* script_state,
ScriptValue reason,
ExceptionState& exception_state) { … }
ScriptPromise<IDLUndefined> WritableStreamDefaultWriter::close(
ScriptState* script_state,
ExceptionState& exception_state) { … }
void WritableStreamDefaultWriter::releaseLock(ScriptState* script_state) { … }
ScriptPromise<IDLUndefined> WritableStreamDefaultWriter::write(
ScriptState* script_state,
ExceptionState& exception_state) { … }
ScriptPromise<IDLUndefined> WritableStreamDefaultWriter::write(
ScriptState* script_state,
ScriptValue chunk,
ExceptionState& exception_state) { … }
void WritableStreamDefaultWriter::EnsureReadyPromiseRejected(
ScriptState* script_state,
WritableStreamDefaultWriter* writer,
v8::Local<v8::Value> error) { … }
ScriptPromise<IDLUndefined>
WritableStreamDefaultWriter::CloseWithErrorPropagation(
ScriptState* script_state,
WritableStreamDefaultWriter* writer) { … }
void WritableStreamDefaultWriter::Release(ScriptState* script_state,
WritableStreamDefaultWriter* writer) { … }
ScriptPromiseResolver<IDLUndefined>* WritableStreamDefaultWriter::Write(
ScriptState* script_state,
WritableStreamDefaultWriter* writer,
v8::Local<v8::Value> chunk,
ExceptionState& exception_state) { … }
std::optional<double> WritableStreamDefaultWriter::GetDesiredSizeInternal()
const { … }
void WritableStreamDefaultWriter::ResetReadyPromise(ScriptState* script_state) { … }
void WritableStreamDefaultWriter::Trace(Visitor* visitor) const { … }
ScriptPromise<IDLUndefined> WritableStreamDefaultWriter::Abort(
ScriptState* script_state,
WritableStreamDefaultWriter* writer,
v8::Local<v8::Value> reason) { … }
ScriptPromise<IDLUndefined> WritableStreamDefaultWriter::Close(
ScriptState* script_state,
WritableStreamDefaultWriter* writer) { … }
void WritableStreamDefaultWriter::EnsureClosedPromiseRejected(
ScriptState* script_state,
WritableStreamDefaultWriter* writer,
v8::Local<v8::Value> error) { … }
v8::Local<v8::Value> WritableStreamDefaultWriter::GetDesiredSize(
v8::Isolate* isolate,
const WritableStreamDefaultWriter* writer) { … }
}