#include "content/browser/service_worker/service_worker_script_cache_map.h"
#include <utility>
#include "base/check_op.h"
#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/not_fatal_until.h"
#include "content/browser/service_worker/service_worker_consts.h"
#include "content/browser/service_worker/service_worker_context_core.h"
#include "content/browser/service_worker/service_worker_version.h"
#include "net/base/net_errors.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
namespace content {
ServiceWorkerScriptCacheMap::ServiceWorkerScriptCacheMap(
ServiceWorkerVersion* owner,
base::WeakPtr<ServiceWorkerContextCore> context)
: … { … }
ServiceWorkerScriptCacheMap::~ServiceWorkerScriptCacheMap() { … }
int64_t ServiceWorkerScriptCacheMap::LookupResourceId(const GURL& url) { … }
std::optional<std::string> ServiceWorkerScriptCacheMap::LookupSha256Checksum(
const GURL& url) { … }
void ServiceWorkerScriptCacheMap::NotifyStartedCaching(const GURL& url,
int64_t resource_id) { … }
void ServiceWorkerScriptCacheMap::NotifyFinishedCaching(
const GURL& url,
int64_t size_bytes,
const std::string& sha256_checksum,
net::Error net_error,
const std::string& status_message) { … }
std::vector<storage::mojom::ServiceWorkerResourceRecordPtr>
ServiceWorkerScriptCacheMap::GetResources() const { … }
void ServiceWorkerScriptCacheMap::SetResources(
const std::vector<storage::mojom::ServiceWorkerResourceRecordPtr>&
resources) { … }
void ServiceWorkerScriptCacheMap::UpdateSha256Checksum(
const GURL& url,
const std::string& sha256_checksum) { … }
void ServiceWorkerScriptCacheMap::WriteMetadata(
const GURL& url,
base::span<const uint8_t> data,
net::CompletionOnceCallback callback) { … }
void ServiceWorkerScriptCacheMap::ClearMetadata(
const GURL& url,
net::CompletionOnceCallback callback) { … }
void ServiceWorkerScriptCacheMap::OnWriterDisconnected(uint64_t callback_id) { … }
void ServiceWorkerScriptCacheMap::OnMetadataWritten(
mojo::Remote<storage::mojom::ServiceWorkerResourceMetadataWriter> writer,
uint64_t callback_id,
int result) { … }
void ServiceWorkerScriptCacheMap::RunCallback(uint64_t callback_id,
int result) { … }
}