#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/platform/loader/fetch/url_loader/cached_metadata_handler.h"
#include "base/time/time.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
#include "third_party/blink/public/mojom/loader/code_cache.mojom-blink.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_security_origin.h"
#include "third_party/blink/public/platform/web_url.h"
#include "third_party/blink/renderer/platform/loader/fetch/code_cache_host.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_response.h"
namespace blink {
class CachedMetadataSenderImpl : public CachedMetadataSender { … };
CachedMetadataSenderImpl::CachedMetadataSenderImpl(
const ResourceResponse& response,
mojom::blink::CodeCacheType code_cache_type)
: … { … }
void CachedMetadataSenderImpl::Send(CodeCacheHost* code_cache_host,
base::span<const uint8_t> data) { … }
class NullCachedMetadataSender : public CachedMetadataSender { … };
class ServiceWorkerCachedMetadataSender : public CachedMetadataSender { … };
ServiceWorkerCachedMetadataSender::ServiceWorkerCachedMetadataSender(
const ResourceResponse& response,
scoped_refptr<const SecurityOrigin> security_origin)
: … { … }
void ServiceWorkerCachedMetadataSender::Send(CodeCacheHost* code_cache_host,
base::span<const uint8_t> data) { … }
void CachedMetadataSender::SendToCodeCacheHost(
CodeCacheHost* code_cache_host,
mojom::blink::CodeCacheType code_cache_type,
WTF::String url,
base::Time response_time,
const String& cache_storage_name,
const uint8_t* data,
size_t size) { … }
std::unique_ptr<CachedMetadataSender> CachedMetadataSender::Create(
const ResourceResponse& response,
mojom::blink::CodeCacheType code_cache_type,
scoped_refptr<const SecurityOrigin> requestor_origin) { … }
bool ShouldUseIsolatedCodeCache(
mojom::blink::RequestContextType request_context,
const ResourceResponse& response) { … }
}