#include "third_party/blink/renderer/core/streams/writable_stream.h"
#include "third_party/blink/renderer/bindings/core/v8/script_value.h"
#include "third_party/blink/renderer/bindings/core/v8/to_v8_traits.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_queuing_strategy_init.h"
#include "third_party/blink/renderer/core/dom/abort_signal.h"
#include "third_party/blink/renderer/core/streams/count_queuing_strategy.h"
#include "third_party/blink/renderer/core/streams/miscellaneous_operations.h"
#include "third_party/blink/renderer/core/streams/pipe_options.h"
#include "third_party/blink/renderer/core/streams/promise_handler.h"
#include "third_party/blink/renderer/core/streams/readable_stream.h"
#include "third_party/blink/renderer/core/streams/readable_stream_transferring_optimizer.h"
#include "third_party/blink/renderer/core/streams/transferable_streams.h"
#include "third_party/blink/renderer/core/streams/underlying_sink_base.h"
#include "third_party/blink/renderer/core/streams/writable_stream_default_controller.h"
#include "third_party/blink/renderer/core/streams/writable_stream_default_writer.h"
#include "third_party/blink/renderer/core/streams/writable_stream_transferring_optimizer.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/heap/visitor.h"
namespace blink {
class WritableStream::PendingAbortRequest final
: public GarbageCollected<PendingAbortRequest> { … };
WritableStream* WritableStream::Create(ScriptState* script_state,
ExceptionState& exception_state) { … }
WritableStream* WritableStream::Create(ScriptState* script_state,
ScriptValue underlying_sink,
ExceptionState& exception_state) { … }
WritableStream* WritableStream::Create(ScriptState* script_state,
ScriptValue raw_underlying_sink,
ScriptValue raw_strategy,
ExceptionState& exception_state) { … }
WritableStream::WritableStream() = default;
WritableStream::~WritableStream() = default;
ScriptPromise<IDLUndefined> WritableStream::abort(
ScriptState* script_state,
ExceptionState& exception_state) { … }
ScriptPromise<IDLUndefined> WritableStream::abort(
ScriptState* script_state,
ScriptValue reason,
ExceptionState& exception_state) { … }
ScriptPromise<IDLUndefined> WritableStream::close(
ScriptState* script_state,
ExceptionState& exception_state) { … }
WritableStreamDefaultWriter* WritableStream::getWriter(
ScriptState* script_state,
ExceptionState& exception_state) { … }
WritableStream* WritableStream::Create(ScriptState* script_state,
StreamStartAlgorithm* start_algorithm,
StreamAlgorithm* write_algorithm,
StreamAlgorithm* close_algorithm,
StreamAlgorithm* abort_algorithm,
double high_water_mark,
StrategySizeAlgorithm* size_algorithm,
ExceptionState& exception_state) { … }
WritableStream* WritableStream::CreateWithCountQueueingStrategy(
ScriptState* script_state,
UnderlyingSinkBase* underlying_sink,
size_t high_water_mark) { … }
WritableStream* WritableStream::CreateWithCountQueueingStrategy(
ScriptState* script_state,
UnderlyingSinkBase* underlying_sink,
size_t high_water_mark,
std::unique_ptr<WritableStreamTransferringOptimizer> optimizer) { … }
void WritableStream::InitWithCountQueueingStrategy(
ScriptState* script_state,
UnderlyingSinkBase* underlying_sink,
size_t high_water_mark,
std::unique_ptr<WritableStreamTransferringOptimizer> optimizer,
ExceptionState& exception_state) { … }
void WritableStream::Serialize(ScriptState* script_state,
MessagePort* port,
ExceptionState& exception_state) { … }
WritableStream* WritableStream::Deserialize(
ScriptState* script_state,
MessagePort* port,
std::unique_ptr<WritableStreamTransferringOptimizer> optimizer,
ExceptionState& exception_state) { … }
WritableStreamDefaultWriter* WritableStream::AcquireDefaultWriter(
ScriptState* script_state,
WritableStream* stream,
ExceptionState& exception_state) { … }
ScriptPromise<IDLUndefined> WritableStream::Abort(ScriptState* script_state,
WritableStream* stream,
v8::Local<v8::Value> reason) { … }
void WritableStream::AddWriteRequest(
WritableStream* stream,
ScriptPromiseResolver<IDLUndefined>* resolver) { … }
ScriptPromise<IDLUndefined> WritableStream::Close(ScriptState* script_state,
WritableStream* stream) { … }
bool WritableStream::CloseQueuedOrInFlight(const WritableStream* stream) { … }
void WritableStream::DealWithRejection(ScriptState* script_state,
WritableStream* stream,
v8::Local<v8::Value> error) { … }
void WritableStream::StartErroring(ScriptState* script_state,
WritableStream* stream,
v8::Local<v8::Value> reason) { … }
void WritableStream::FinishErroring(ScriptState* script_state,
WritableStream* stream) { … }
void WritableStream::FinishInFlightWrite(ScriptState* script_state,
WritableStream* stream) { … }
void WritableStream::FinishInFlightWriteWithError(ScriptState* script_state,
WritableStream* stream,
v8::Local<v8::Value> error) { … }
void WritableStream::FinishInFlightClose(ScriptState* script_state,
WritableStream* stream) { … }
void WritableStream::FinishInFlightCloseWithError(ScriptState* script_state,
WritableStream* stream,
v8::Local<v8::Value> error) { … }
void WritableStream::MarkCloseRequestInFlight(WritableStream* stream) { … }
void WritableStream::MarkFirstWriteRequestInFlight(WritableStream* stream) { … }
void WritableStream::UpdateBackpressure(ScriptState* script_state,
WritableStream* stream,
bool backpressure) { … }
v8::Local<v8::Value> WritableStream::GetStoredError(
v8::Isolate* isolate) const { … }
void WritableStream::SetCloseRequest(
ScriptPromiseResolver<IDLUndefined>* close_request) { … }
void WritableStream::SetController(
WritableStreamDefaultController* controller) { … }
void WritableStream::SetWriter(WritableStreamDefaultWriter* writer) { … }
std::unique_ptr<WritableStreamTransferringOptimizer>
WritableStream::TakeTransferringOptimizer() { … }
v8::Local<v8::String> WritableStream::CreateCannotActionOnStateStreamMessage(
v8::Isolate* isolate,
const char* action,
const char* state_name) { … }
v8::Local<v8::Value> WritableStream::CreateCannotActionOnStateStreamException(
v8::Isolate* isolate,
const char* action,
State state) { … }
void WritableStream::Trace(Visitor* visitor) const { … }
void WritableStream::InitInternal(ScriptState* script_state,
ScriptValue raw_underlying_sink,
ScriptValue raw_strategy,
ExceptionState& exception_state) { … }
bool WritableStream::HasOperationMarkedInFlight(const WritableStream* stream) { … }
void WritableStream::RejectCloseAndClosedPromiseIfNeeded(
ScriptState* script_state,
WritableStream* stream) { … }
void WritableStream::RejectPromises(ScriptState* script_state,
PromiseQueue* queue,
v8::Local<v8::Value> e) { … }
}