#include "net/quic/quic_chromium_client_stream.h"
#include <string_view>
#include <utility>
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/not_fatal_until.h"
#include "base/task/single_thread_task_runner.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "net/base/url_util.h"
#include "net/http/http_status_code.h"
#include "net/log/net_log_event_type.h"
#include "net/quic/quic_chromium_client_session.h"
#include "net/quic/quic_http_utils.h"
#include "net/spdy/spdy_log_util.h"
#include "net/third_party/quiche/src/quiche/quic/core/http/quic_spdy_session.h"
#include "net/third_party/quiche/src/quiche/quic/core/http/spdy_utils.h"
#include "net/third_party/quiche/src/quiche/quic/core/quic_utils.h"
#include "net/third_party/quiche/src/quiche/quic/core/quic_write_blocked_list.h"
namespace net {
namespace {
class ScopedBoolSaver { … };
}
QuicChromiumClientStream::Handle::Handle(QuicChromiumClientStream* stream)
: … { … }
QuicChromiumClientStream::Handle::~Handle() { … }
void QuicChromiumClientStream::Handle::OnEarlyHintsAvailable() { … }
void QuicChromiumClientStream::Handle::OnInitialHeadersAvailable() { … }
void QuicChromiumClientStream::Handle::OnTrailingHeadersAvailable() { … }
void QuicChromiumClientStream::Handle::OnDataAvailable() { … }
void QuicChromiumClientStream::Handle::OnCanWrite() { … }
void QuicChromiumClientStream::Handle::OnClose() { … }
void QuicChromiumClientStream::Handle::OnError(int error) { … }
void QuicChromiumClientStream::Handle::InvokeCallbacksOnClose(int error) { … }
int QuicChromiumClientStream::Handle::ReadInitialHeaders(
quiche::HttpHeaderBlock* header_block,
CompletionOnceCallback callback) { … }
int QuicChromiumClientStream::Handle::ReadBody(
IOBuffer* buffer,
int buffer_len,
CompletionOnceCallback callback) { … }
int QuicChromiumClientStream::Handle::ReadTrailingHeaders(
quiche::HttpHeaderBlock* header_block,
CompletionOnceCallback callback) { … }
int QuicChromiumClientStream::Handle::WriteHeaders(
quiche::HttpHeaderBlock header_block,
bool fin,
quiche::QuicheReferenceCountedPointer<quic::QuicAckListenerInterface>
ack_notifier_delegate) { … }
int QuicChromiumClientStream::Handle::WriteStreamData(
std::string_view data,
bool fin,
CompletionOnceCallback callback) { … }
int QuicChromiumClientStream::Handle::WritevStreamData(
const std::vector<scoped_refptr<IOBuffer>>& buffers,
const std::vector<int>& lengths,
bool fin,
CompletionOnceCallback callback) { … }
int QuicChromiumClientStream::Handle::WriteConnectUdpPayload(
std::string_view packet) { … }
int QuicChromiumClientStream::Handle::Read(IOBuffer* buf, int buf_len) { … }
void QuicChromiumClientStream::Handle::OnFinRead() { … }
void QuicChromiumClientStream::Handle::
DisableConnectionMigrationToCellularNetwork() { … }
void QuicChromiumClientStream::Handle::SetPriority(
const quic::QuicStreamPriority& priority) { … }
void QuicChromiumClientStream::Handle::Reset(
quic::QuicRstStreamErrorCode error_code) { … }
void QuicChromiumClientStream::Handle::RegisterHttp3DatagramVisitor(
Http3DatagramVisitor* visitor) { … }
void QuicChromiumClientStream::Handle::UnregisterHttp3DatagramVisitor() { … }
quic::QuicStreamId QuicChromiumClientStream::Handle::id() const { … }
quic::QuicErrorCode QuicChromiumClientStream::Handle::connection_error() const { … }
quic::QuicRstStreamErrorCode QuicChromiumClientStream::Handle::stream_error()
const { … }
uint64_t QuicChromiumClientStream::Handle::connection_wire_error() const { … }
uint64_t QuicChromiumClientStream::Handle::ietf_application_error() const { … }
bool QuicChromiumClientStream::Handle::fin_sent() const { … }
bool QuicChromiumClientStream::Handle::fin_received() const { … }
uint64_t QuicChromiumClientStream::Handle::stream_bytes_read() const { … }
uint64_t QuicChromiumClientStream::Handle::stream_bytes_written() const { … }
size_t QuicChromiumClientStream::Handle::NumBytesConsumed() const { … }
bool QuicChromiumClientStream::Handle::HasBytesToRead() const { … }
bool QuicChromiumClientStream::Handle::IsDoneReading() const { … }
bool QuicChromiumClientStream::Handle::IsFirstStream() const { … }
bool QuicChromiumClientStream::Handle::can_migrate_to_cellular_network() { … }
const NetLogWithSource& QuicChromiumClientStream::Handle::net_log() const { … }
void QuicChromiumClientStream::Handle::SaveState() { … }
void QuicChromiumClientStream::Handle::SetCallback(
CompletionOnceCallback new_callback,
CompletionOnceCallback* callback) { … }
void QuicChromiumClientStream::Handle::ResetAndRun(
CompletionOnceCallback callback,
int rv) { … }
int QuicChromiumClientStream::Handle::HandleIOComplete(int rv) { … }
void QuicChromiumClientStream::Handle::SetRequestIdempotency(
Idempotency idempotency) { … }
Idempotency QuicChromiumClientStream::Handle::GetRequestIdempotency() const { … }
quic::QuicPacketLength
QuicChromiumClientStream::Handle::GetGuaranteedLargestMessagePayload() const { … }
QuicChromiumClientStream::QuicChromiumClientStream(
quic::QuicStreamId id,
quic::QuicSpdyClientSessionBase* session,
quic::QuicServerId server_id,
quic::StreamType type,
const NetLogWithSource& net_log,
const NetworkTrafficAnnotationTag& traffic_annotation)
: … { … }
QuicChromiumClientStream::QuicChromiumClientStream(
quic::PendingStream* pending,
quic::QuicSpdyClientSessionBase* session,
quic::QuicServerId server_id,
const NetLogWithSource& net_log,
const NetworkTrafficAnnotationTag& traffic_annotation)
: … { … }
QuicChromiumClientStream::~QuicChromiumClientStream() { … }
void QuicChromiumClientStream::OnInitialHeadersComplete(
bool fin,
size_t frame_len,
const quic::QuicHeaderList& header_list) { … }
void QuicChromiumClientStream::OnTrailingHeadersComplete(
bool fin,
size_t frame_len,
const quic::QuicHeaderList& header_list) { … }
void QuicChromiumClientStream::OnBodyAvailable() { … }
void QuicChromiumClientStream::OnClose() { … }
void QuicChromiumClientStream::OnCanWrite() { … }
size_t QuicChromiumClientStream::WriteHeaders(
quiche::HttpHeaderBlock header_block,
bool fin,
quiche::QuicheReferenceCountedPointer<quic::QuicAckListenerInterface>
ack_listener) { … }
bool QuicChromiumClientStream::WriteStreamData(std::string_view data,
bool fin) { … }
bool QuicChromiumClientStream::WritevStreamData(
const std::vector<scoped_refptr<IOBuffer>>& buffers,
const std::vector<int>& lengths,
bool fin) { … }
std::unique_ptr<QuicChromiumClientStream::Handle>
QuicChromiumClientStream::CreateHandle() { … }
void QuicChromiumClientStream::ClearHandle() { … }
void QuicChromiumClientStream::OnError(int error) { … }
bool QuicChromiumClientStream::SupportsH3Datagram() const { … }
int QuicChromiumClientStream::Read(IOBuffer* buf, int buf_len) { … }
void QuicChromiumClientStream::NotifyHandleOfInitialHeadersAvailableLater() { … }
void QuicChromiumClientStream::NotifyHandleOfInitialHeadersAvailable() { … }
void QuicChromiumClientStream::NotifyHandleOfTrailingHeadersAvailableLater() { … }
void QuicChromiumClientStream::NotifyHandleOfTrailingHeadersAvailable() { … }
int QuicChromiumClientStream::DeliverEarlyHints(
quiche::HttpHeaderBlock* headers) { … }
int QuicChromiumClientStream::DeliverInitialHeaders(
quiche::HttpHeaderBlock* headers) { … }
bool QuicChromiumClientStream::DeliverTrailingHeaders(
quiche::HttpHeaderBlock* headers,
int* frame_len) { … }
void QuicChromiumClientStream::NotifyHandleOfDataAvailableLater() { … }
void QuicChromiumClientStream::NotifyHandleOfDataAvailable() { … }
void QuicChromiumClientStream::DisableConnectionMigrationToCellularNetwork() { … }
quic::QuicPacketLength
QuicChromiumClientStream::GetGuaranteedLargestMessagePayload() const { … }
bool QuicChromiumClientStream::IsFirstStream() { … }
}