#include "storage/browser/blob/blob_url_registry.h"
#include "base/check.h"
#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "net/base/features.h"
#include "storage/browser/blob/blob_url_store_impl.h"
#include "storage/browser/blob/blob_url_utils.h"
#include "url/gurl.h"
namespace storage {
namespace {
BlobUrlRegistry::URLStoreCreationHook* g_url_store_creation_hook = …;
}
BlobUrlRegistry::BlobUrlRegistry(base::WeakPtr<BlobUrlRegistry> fallback)
: … { … }
BlobUrlRegistry::~BlobUrlRegistry() { … }
void BlobUrlRegistry::AddReceiver(
const blink::StorageKey& storage_key,
const url::Origin& renderer_origin,
int render_process_host_id,
mojo::PendingAssociatedReceiver<blink::mojom::BlobURLStore> receiver) { … }
void BlobUrlRegistry::AddReceiver(
const blink::StorageKey& storage_key,
const url::Origin& renderer_origin,
int render_process_host_id,
mojo::PendingReceiver<blink::mojom::BlobURLStore> receiver,
BlobURLValidityCheckBehavior validity_check_behavior) { … }
bool BlobUrlRegistry::AddUrlMapping(
const GURL& blob_url,
mojo::PendingRemote<blink::mojom::Blob> blob,
const blink::StorageKey& storage_key,
const url::Origin& renderer_origin,
int render_process_host_id,
const base::UnguessableToken& unsafe_agent_cluster_id,
const std::optional<net::SchemefulSite>& unsafe_top_level_site) { … }
bool BlobUrlRegistry::RemoveUrlMapping(const GURL& blob_url,
const blink::StorageKey& storage_key) { … }
url::Origin BlobUrlRegistry::GetOriginForNavigation(
const GURL& url,
const url::Origin& precursor_origin,
std::optional<int> target_render_process_host_id) { … }
bool BlobUrlRegistry::IsUrlMapped(const GURL& blob_url,
const blink::StorageKey& storage_key) const { … }
std::optional<base::UnguessableToken> BlobUrlRegistry::GetUnsafeAgentClusterID(
const GURL& blob_url) const { … }
std::optional<net::SchemefulSite> BlobUrlRegistry::GetUnsafeTopLevelSite(
const GURL& blob_url) const { … }
mojo::PendingRemote<blink::mojom::Blob> BlobUrlRegistry::GetBlobFromUrl(
const GURL& url) { … }
void BlobUrlRegistry::AddTokenMapping(
const base::UnguessableToken& token,
const GURL& url,
mojo::PendingRemote<blink::mojom::Blob> blob) { … }
void BlobUrlRegistry::RemoveTokenMapping(const base::UnguessableToken& token) { … }
bool BlobUrlRegistry::GetTokenMapping(
const base::UnguessableToken& token,
GURL* url,
mojo::PendingRemote<blink::mojom::Blob>* blob) { … }
void BlobUrlRegistry::SetURLStoreCreationHookForTesting(
URLStoreCreationHook* hook) { … }
}