#include "net/websockets/websocket_http3_handshake_stream.h"
#include <string_view>
#include <utility>
#include "base/check.h"
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/scoped_refptr.h"
#include "base/strings/strcat.h"
#include "base/strings/stringprintf.h"
#include "base/time/time.h"
#include "net/base/ip_endpoint.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_request_info.h"
#include "net/http/http_response_headers.h"
#include "net/http/http_response_info.h"
#include "net/http/http_status_code.h"
#include "net/spdy/spdy_http_utils.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "net/websockets/websocket_basic_stream.h"
#include "net/websockets/websocket_deflate_predictor_impl.h"
#include "net/websockets/websocket_deflate_stream.h"
#include "net/websockets/websocket_handshake_constants.h"
#include "net/websockets/websocket_handshake_request_info.h"
namespace net {
struct AlternativeService;
namespace {
bool ValidateStatus(const HttpResponseHeaders* headers) { … }
}
WebSocketHttp3HandshakeStream::WebSocketHttp3HandshakeStream(
std::unique_ptr<QuicChromiumClientSession::Handle> session,
WebSocketStream::ConnectDelegate* connect_delegate,
std::vector<std::string> requested_sub_protocols,
std::vector<std::string> requested_extensions,
WebSocketStreamRequestAPI* request,
std::set<std::string> dns_aliases)
: … { … }
WebSocketHttp3HandshakeStream::~WebSocketHttp3HandshakeStream() { … }
void WebSocketHttp3HandshakeStream::RegisterRequest(
const HttpRequestInfo* request_info) { … }
int WebSocketHttp3HandshakeStream::InitializeStream(
bool can_send_early,
RequestPriority priority,
const NetLogWithSource& net_log,
CompletionOnceCallback callback) { … }
int WebSocketHttp3HandshakeStream::SendRequest(
const HttpRequestHeaders& request_headers,
HttpResponseInfo* response,
CompletionOnceCallback callback) { … }
int WebSocketHttp3HandshakeStream::ReadResponseHeaders(
CompletionOnceCallback callback) { … }
int WebSocketHttp3HandshakeStream::ReadResponseBody(
IOBuffer* buf,
int buf_len,
CompletionOnceCallback callback) { … }
void WebSocketHttp3HandshakeStream::Close(bool not_reusable) { … }
bool WebSocketHttp3HandshakeStream::IsResponseBodyComplete() const { … }
bool WebSocketHttp3HandshakeStream::IsConnectionReused() const { … }
void WebSocketHttp3HandshakeStream::SetConnectionReused() { … }
bool WebSocketHttp3HandshakeStream::CanReuseConnection() const { … }
int64_t WebSocketHttp3HandshakeStream::GetTotalReceivedBytes() const { … }
int64_t WebSocketHttp3HandshakeStream::GetTotalSentBytes() const { … }
bool WebSocketHttp3HandshakeStream::GetAlternativeService(
AlternativeService* alternative_service) const { … }
bool WebSocketHttp3HandshakeStream::GetLoadTimingInfo(
LoadTimingInfo* load_timing_info) const { … }
void WebSocketHttp3HandshakeStream::GetSSLInfo(SSLInfo* ssl_info) { … }
int WebSocketHttp3HandshakeStream::GetRemoteEndpoint(IPEndPoint* endpoint) { … }
void WebSocketHttp3HandshakeStream::Drain(HttpNetworkSession* session) { … }
void WebSocketHttp3HandshakeStream::SetPriority(RequestPriority priority) { … }
void WebSocketHttp3HandshakeStream::PopulateNetErrorDetails(
NetErrorDetails* details) { … }
std::unique_ptr<HttpStream>
WebSocketHttp3HandshakeStream::RenewStreamForAuth() { … }
const std::set<std::string>& WebSocketHttp3HandshakeStream::GetDnsAliases()
const { … }
std::string_view WebSocketHttp3HandshakeStream::GetAcceptChViaAlps() const { … }
std::unique_ptr<WebSocketStream> WebSocketHttp3HandshakeStream::Upgrade() { … }
bool WebSocketHttp3HandshakeStream::CanReadFromStream() const { … }
base::WeakPtr<WebSocketHandshakeStreamBase>
WebSocketHttp3HandshakeStream::GetWeakPtr() { … }
void WebSocketHttp3HandshakeStream::OnHeadersSent() { … }
void WebSocketHttp3HandshakeStream::OnHeadersReceived(
const quiche::HttpHeaderBlock& response_headers) { … }
void WebSocketHttp3HandshakeStream::OnClose(int status) { … }
void WebSocketHttp3HandshakeStream::ReceiveAdapterAndStartRequest(
std::unique_ptr<WebSocketQuicStreamAdapter> adapter) { … }
int WebSocketHttp3HandshakeStream::ValidateResponse() { … }
int WebSocketHttp3HandshakeStream::ValidateUpgradeResponse(
const HttpResponseHeaders* headers) { … }
void WebSocketHttp3HandshakeStream::OnFailure(
const std::string& message,
int net_error,
std::optional<int> response_code) { … }
}