#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "net/spdy/spdy_http_utils.h"
#include <string>
#include <string_view>
#include <vector>
#include "base/check_op.h"
#include "base/feature_list.h"
#include "base/strings/strcat.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/types/expected.h"
#include "base/types/expected_macros.h"
#include "net/base/features.h"
#include "net/base/url_util.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_util.h"
#include "net/quic/quic_http_utils.h"
#include "net/third_party/quiche/src/quiche/quic/core/quic_stream_priority.h"
namespace net {
const char* const kHttp2PriorityHeader = …;
namespace {
constexpr size_t kExpectedRawHeaderSize = …;
void AddUniqueSpdyHeader(std::string_view name,
std::string_view value,
quiche::HttpHeaderBlock* headers) { … }
base::expected<scoped_refptr<HttpResponseHeaders>, int>
SpdyHeadersToHttpResponseHeadersUsingFeatures(
const quiche::HttpHeaderBlock& headers) { … }
}
int SpdyHeadersToHttpResponse(const quiche::HttpHeaderBlock& headers,
HttpResponseInfo* response) { … }
NET_EXPORT_PRIVATE base::expected<scoped_refptr<HttpResponseHeaders>, int>
SpdyHeadersToHttpResponseHeadersUsingRawString(
const quiche::HttpHeaderBlock& headers) { … }
NET_EXPORT_PRIVATE base::expected<scoped_refptr<HttpResponseHeaders>, int>
SpdyHeadersToHttpResponseHeadersUsingBuilder(
const quiche::HttpHeaderBlock& headers) { … }
void CreateSpdyHeadersFromHttpRequest(const HttpRequestInfo& info,
std::optional<RequestPriority> priority,
const HttpRequestHeaders& request_headers,
quiche::HttpHeaderBlock* headers) { … }
void CreateSpdyHeadersFromHttpRequestForExtendedConnect(
const HttpRequestInfo& info,
std::optional<RequestPriority> priority,
const std::string& ext_connect_protocol,
const HttpRequestHeaders& request_headers,
quiche::HttpHeaderBlock* headers) { … }
void CreateSpdyHeadersFromHttpRequestForWebSocket(
const GURL& url,
const HttpRequestHeaders& request_headers,
quiche::HttpHeaderBlock* headers) { … }
static_assert …;
spdy::SpdyPriority ConvertRequestPriorityToSpdyPriority(
const RequestPriority priority) { … }
NET_EXPORT_PRIVATE RequestPriority
ConvertSpdyPriorityToRequestPriority(spdy::SpdyPriority priority) { … }
NET_EXPORT_PRIVATE void ConvertHeaderBlockToHttpRequestHeaders(
const quiche::HttpHeaderBlock& spdy_headers,
HttpRequestHeaders* http_headers) { … }
}