chromium/third_party/blink/renderer/modules/webtransport/incoming_stream.cc

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/modules/webtransport/incoming_stream.h"

#include <string.h>

#include <utility>

#include "base/compiler_specific.h"
#include "third_party/blink/renderer/bindings/core/v8/script_function.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_throw_dom_exception.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_web_transport_error.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/streams/readable_stream.h"
#include "third_party/blink/renderer/core/streams/readable_stream_byob_request.h"
#include "third_party/blink/renderer/core/streams/readable_stream_default_controller_with_script_scope.h"
#include "third_party/blink/renderer/core/streams/readable_stream_generic_reader.h"
#include "third_party/blink/renderer/core/streams/readable_stream_transferring_optimizer.h"
#include "third_party/blink/renderer/core/streams/stream_promise_resolver.h"
#include "third_party/blink/renderer/core/streams/underlying_byte_source_base.h"
#include "third_party/blink/renderer/core/typed_arrays/array_buffer/array_buffer_contents.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_array_piece.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_typed_array.h"
#include "third_party/blink/renderer/modules/webtransport/web_transport_error.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/bindings/trace_wrapper_v8_reference.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/wtf/functional.h"
#include "v8/include/v8.h"

namespace blink {

// An implementation of UnderlyingByteSourceBase that forwards all operations to
// the IncomingStream object that created it.
class IncomingStream::UnderlyingByteSource final
    : public UnderlyingByteSourceBase {};

IncomingStream::IncomingStream(
    ScriptState* script_state,
    base::OnceCallback<void(std::optional<uint8_t>)> on_abort,
    mojo::ScopedDataPipeConsumerHandle handle)
    :{}

IncomingStream::~IncomingStream() = default;

void IncomingStream::Init(ExceptionState& exception_state) {}

void IncomingStream::InitWithExistingReadableStream(
    ReadableStream* stream,
    ExceptionState& exception_state) {}

void IncomingStream::OnIncomingStreamClosed(bool fin_received) {}

void IncomingStream::Error(ScriptValue reason) {}

void IncomingStream::ContextDestroyed() {}

void IncomingStream::Trace(Visitor* visitor) const {}

void IncomingStream::OnHandleReady(MojoResult result,
                                   const mojo::HandleSignalsState&) {}

void IncomingStream::HandlePipeClosed() {}

void IncomingStream::ProcessClose() {}

void IncomingStream::ReadFromPipeAndEnqueue(ExceptionState& exception_state) {}

size_t IncomingStream::RespondBYOBRequestOrEnqueueBytes(
    base::span<const uint8_t> source,
    ExceptionState& exception_state) {}

void IncomingStream::CloseAbortAndReset(ExceptionState& exception_state) {}

void IncomingStream::ErrorStreamAbortAndReset(ScriptValue exception) {}

void IncomingStream::AbortAndReset(std::optional<uint8_t> code) {}

void IncomingStream::ResetPipe() {}

void IncomingStream::Dispose() {}

}  // namespace blink