#include "quiche/quic/tools/quic_memory_cache_backend.h"
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "absl/strings/match.h"
#include "absl/strings/numbers.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"
#include "quiche/quic/core/http/spdy_utils.h"
#include "quiche/quic/platform/api/quic_bug_tracker.h"
#include "quiche/quic/platform/api/quic_logging.h"
#include "quiche/quic/tools/web_transport_test_visitors.h"
#include "quiche/common/platform/api/quiche_file_utils.h"
#include "quiche/common/quiche_text_utils.h"
HttpHeaderBlock;
kV3LowestPriority;
namespace quic {
QuicMemoryCacheBackend::ResourceFile::ResourceFile(const std::string& file_name)
: … { … }
QuicMemoryCacheBackend::ResourceFile::~ResourceFile() = default;
void QuicMemoryCacheBackend::ResourceFile::Read() { … }
void QuicMemoryCacheBackend::ResourceFile::SetHostPathFromBase(
absl::string_view base) { … }
absl::string_view QuicMemoryCacheBackend::ResourceFile::RemoveScheme(
absl::string_view url) { … }
void QuicMemoryCacheBackend::ResourceFile::HandleXOriginalUrl() { … }
const QuicBackendResponse* QuicMemoryCacheBackend::GetResponse(
absl::string_view host, absl::string_view path) const { … }
SpecialResponseType;
void QuicMemoryCacheBackend::AddSimpleResponse(absl::string_view host,
absl::string_view path,
int response_code,
absl::string_view body) { … }
void QuicMemoryCacheBackend::AddDefaultResponse(QuicBackendResponse* response) { … }
void QuicMemoryCacheBackend::AddResponse(absl::string_view host,
absl::string_view path,
HttpHeaderBlock response_headers,
absl::string_view response_body) { … }
void QuicMemoryCacheBackend::AddResponse(absl::string_view host,
absl::string_view path,
HttpHeaderBlock response_headers,
absl::string_view response_body,
HttpHeaderBlock response_trailers) { … }
bool QuicMemoryCacheBackend::SetResponseDelay(absl::string_view host,
absl::string_view path,
QuicTime::Delta delay) { … }
void QuicMemoryCacheBackend::AddResponseWithEarlyHints(
absl::string_view host, absl::string_view path,
quiche::HttpHeaderBlock response_headers, absl::string_view response_body,
const std::vector<quiche::HttpHeaderBlock>& early_hints) { … }
void QuicMemoryCacheBackend::AddSpecialResponse(
absl::string_view host, absl::string_view path,
SpecialResponseType response_type) { … }
void QuicMemoryCacheBackend::AddSpecialResponse(
absl::string_view host, absl::string_view path,
quiche::HttpHeaderBlock response_headers, absl::string_view response_body,
SpecialResponseType response_type) { … }
QuicMemoryCacheBackend::QuicMemoryCacheBackend() : … { … }
bool QuicMemoryCacheBackend::InitializeBackend(
const std::string& cache_directory) { … }
void QuicMemoryCacheBackend::GenerateDynamicResponses() { … }
void QuicMemoryCacheBackend::EnableWebTransport() { … }
bool QuicMemoryCacheBackend::IsBackendInitialized() const { … }
void QuicMemoryCacheBackend::FetchResponseFromBackend(
const HttpHeaderBlock& request_headers, const std::string& request_body,
QuicSimpleServerBackend::RequestHandler* quic_stream) { … }
void QuicMemoryCacheBackend::CloseBackendResponseStream(
QuicSimpleServerBackend::RequestHandler* ) { … }
QuicMemoryCacheBackend::WebTransportResponse
QuicMemoryCacheBackend::ProcessWebTransportRequest(
const quiche::HttpHeaderBlock& request_headers,
WebTransportSession* session) { … }
QuicMemoryCacheBackend::~QuicMemoryCacheBackend() { … }
void QuicMemoryCacheBackend::AddResponseImpl(
absl::string_view host, absl::string_view path,
SpecialResponseType response_type, HttpHeaderBlock response_headers,
absl::string_view response_body, HttpHeaderBlock response_trailers,
const std::vector<quiche::HttpHeaderBlock>& early_hints) { … }
std::string QuicMemoryCacheBackend::GetKey(absl::string_view host,
absl::string_view path) const { … }
}