#ifndef NET_SPDY_SPDY_HTTP_UTILS_H_
#define NET_SPDY_SPDY_HTTP_UTILS_H_
#include <optional>
#include "base/memory/ref_counted.h"
#include "base/types/expected.h"
#include "net/base/net_export.h"
#include "net/base/request_priority.h"
#include "net/third_party/quiche/src/quiche/common/http/http_header_block.h"
#include "net/third_party/quiche/src/quiche/spdy/core/spdy_framer.h"
#include "net/third_party/quiche/src/quiche/spdy/core/spdy_protocol.h"
#include "url/gurl.h"
namespace net {
class HttpResponseInfo;
struct HttpRequestInfo;
class HttpRequestHeaders;
class HttpResponseHeaders;
NET_EXPORT extern const char* const kHttp2PriorityHeader;
NET_EXPORT 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);
NET_EXPORT void CreateSpdyHeadersFromHttpRequest(
const HttpRequestInfo& info,
std::optional<RequestPriority> priority,
const HttpRequestHeaders& request_headers,
quiche::HttpHeaderBlock* headers);
NET_EXPORT void CreateSpdyHeadersFromHttpRequestForExtendedConnect(
const HttpRequestInfo& info,
std::optional<RequestPriority> priority,
const std::string& ext_connect_protocol,
const HttpRequestHeaders& request_headers,
quiche::HttpHeaderBlock* headers);
NET_EXPORT void CreateSpdyHeadersFromHttpRequestForWebSocket(
const GURL& url,
const HttpRequestHeaders& request_headers,
quiche::HttpHeaderBlock* headers);
NET_EXPORT void ConvertHeaderBlockToHttpRequestHeaders(
const quiche::HttpHeaderBlock& spdy_headers,
HttpRequestHeaders* http_headers);
NET_EXPORT spdy::SpdyPriority ConvertRequestPriorityToSpdyPriority(
RequestPriority priority);
NET_EXPORT RequestPriority
ConvertSpdyPriorityToRequestPriority(spdy::SpdyPriority priority);
}
#endif