Skip to content

Commit

Permalink
Add comments to the added BlobURLStoreImpl logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
goodov committed Apr 1, 2024
1 parent 360daaa commit 323a387
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions chromium_src/storage/browser/blob/blob_url_store_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
namespace storage {

void BlobURLStoreImpl::Resolve(const GURL& url, ResolveCallback callback) {
// If a URL is not mapped to the current `storage_key_`, it's likely stored
// with a different StorageKey (partitioned) and should not be resolved.
if (registry_ && !registry_->IsUrlMapped(url, storage_key_)) {
std::move(callback).Run(mojo::NullRemote(), std::nullopt);
return;
Expand All @@ -26,6 +28,8 @@ void BlobURLStoreImpl::ResolveAsURLLoaderFactory(
const GURL& url,
mojo::PendingReceiver<network::mojom::URLLoaderFactory> receiver,
ResolveAsURLLoaderFactoryCallback callback) {
// If a URL is not mapped to the current `storage_key_`, it's likely stored
// with a different StorageKey (partitioned) and should not be resolved.
if (registry_ && !registry_->IsUrlMapped(url, storage_key_)) {
std::move(callback).Run(std::nullopt, std::nullopt);
return;
Expand All @@ -39,6 +43,8 @@ void BlobURLStoreImpl::ResolveForNavigation(
const GURL& url,
mojo::PendingReceiver<blink::mojom::BlobURLToken> token,
ResolveForNavigationCallback callback) {
// If a URL is not mapped to the current `storage_key_`, it's likely stored
// with a different StorageKey (partitioned) and should not be resolved.
if (registry_ && !registry_->IsUrlMapped(url, storage_key_)) {
std::move(callback).Run(std::nullopt);
return;
Expand Down

0 comments on commit 323a387

Please sign in to comment.