#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/modules/direct_sockets/tcp_writable_stream_wrapper.h"
#include "base/notreached.h"
#include "mojo/public/cpp/system/handle_signals_state.h"
#include "mojo/public/cpp/system/simple_watcher.h"
#include "net/base/net_errors.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_throw_dom_exception.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_typedefs.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_arraybuffer_arraybufferview.h"
#include "third_party/blink/renderer/core/dom/abort_signal.h"
#include "third_party/blink/renderer/core/dom/events/event_target_impl.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/streams/underlying_sink_base.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/core/typed_arrays/dom_array_piece.h"
#include "third_party/blink/renderer/modules/direct_sockets/stream_wrapper.h"
#include "third_party/blink/renderer/modules/direct_sockets/tcp_readable_stream_wrapper.h"
#include "third_party/blink/renderer/platform/bindings/exception_code.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/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/persistent.h"
#include "third_party/blink/renderer/platform/heap/visitor.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
namespace blink {
TCPWritableStreamWrapper::TCPWritableStreamWrapper(
ScriptState* script_state,
CloseOnceCallback on_close,
mojo::ScopedDataPipeProducerHandle handle)
: … { … }
bool TCPWritableStreamWrapper::HasPendingWrite() const { … }
void TCPWritableStreamWrapper::Trace(Visitor* visitor) const { … }
void TCPWritableStreamWrapper::OnHandleReady(MojoResult result,
const mojo::HandleSignalsState&) { … }
void TCPWritableStreamWrapper::OnHandleReset(MojoResult result,
const mojo::HandleSignalsState&) { … }
void TCPWritableStreamWrapper::OnAbortSignal() { … }
ScriptPromise<IDLUndefined> TCPWritableStreamWrapper::Write(
ScriptValue chunk,
ExceptionState& exception_state) { … }
void TCPWritableStreamWrapper::WriteDataAsynchronously() { … }
size_t TCPWritableStreamWrapper::WriteDataSynchronously(
base::span<const uint8_t> data) { … }
void TCPWritableStreamWrapper::FinalizeWrite() { … }
void TCPWritableStreamWrapper::CloseStream() { … }
void TCPWritableStreamWrapper::ErrorStream(int32_t error_code) { … }
void TCPWritableStreamWrapper::ResetPipe() { … }
void TCPWritableStreamWrapper::Dispose() { … }
}