Partition Blink memory cache: no changes, only adjustments to the log

This commit is contained in:
Carmelo Messina
2025-03-22 14:08:58 +01:00
parent 9d31504b39
commit 3ca642bde4
@@ -19,12 +19,12 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
.../core/inspector/inspector_page_agent.cc | 2 +-
.../core/loader/frame_fetch_context.cc | 2 +
.../renderer/core/loader/image_loader.cc | 3 +-
.../core/loader/worker_fetch_context.cc | 3 ++
.../core/loader/worker_fetch_context.cc | 3 +
.../platform/loader/fetch/memory_cache.cc | 8 +--
.../platform/loader/fetch/memory_cache.h | 5 +-
.../platform/loader/fetch/resource_fetcher.cc | 51 +++++++++++++++----
.../platform/loader/fetch/resource_fetcher.cc | 57 ++++++++++++++++---
.../platform/loader/fetch/resource_fetcher.h | 7 ++-
10 files changed, 63 insertions(+), 23 deletions(-)
10 files changed, 69 insertions(+), 23 deletions(-)
diff --git a/third_party/blink/renderer/core/html/parser/html_srcset_parser.cc b/third_party/blink/renderer/core/html/parser/html_srcset_parser.cc
--- a/third_party/blink/renderer/core/html/parser/html_srcset_parser.cc
@@ -184,7 +184,7 @@ diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.c
DCHECK(!IsMainThread() || params.IsStaleRevalidation() ||
!MemoryCache::Get()->ResourceForURL(params.GetResourceRequest().Url(),
cache_identifier));
@@ -2903,11 +2906,41 @@ void ResourceFetcher::UpdateImagePrioritiesAndSpeculativeDecodes() {
@@ -2903,11 +2906,47 @@ void ResourceFetcher::UpdateImagePrioritiesAndSpeculativeDecodes() {
}
String ResourceFetcher::GetCacheIdentifier(const KURL& url,
@@ -200,16 +200,22 @@ diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.c
+ String origin_url = top_origin ? top_origin->ToRawString() : "";
+ String cache_identifier = ResourceFetcher::GetCacheIdentifier(
+ url, skip_service_worker, origin_url);
+ // LOG(INFO) << "---t (" << cache_identifier << ") " << url.GetString() << "='" << origin_url << "'";
+ // LOG(INFO) << "---t (" << cache_identifier << ") "
+ // << url.GetString() << "='" << origin_url << "'";
+ return cache_identifier;
+ }
+ // service workers cannot use the memory cache
+ // } else if (resource_request.GetRequestContext() ==
+ // mojom::blink::RequestContextType::SERVICE_WORKER) {
+ // const scoped_refptr<const SecurityOrigin> requestor_origin = resource_request.RequestorOrigin();
+ // String origin_url = requestor_origin ? requestor_origin->ToRawString() : ""; //context_.Url()->ToRawString();
+ // String cache_identifier = ResourceFetcher::GetCacheIdentifier(url, origin_url);
+ // // LOG(INFO) << "---o (" << cache_identifier << ") " << url.GetString() << "='" << origin_url << "'";
+ // mojom::blink::RequestContextType::SERVICE_WORKER) {
+ // const scoped_refptr<const SecurityOrigin> requestor_origin =
+ // resource_request.RequestorOrigin();
+ // String origin_url = requestor_origin
+ // ? requestor_origin->ToRawString()
+ // : ""; //context_.Url()->ToRawString();
+ // String cache_identifier = ResourceFetcher::GetCacheIdentifier(
+ // url, skip_service_worker, origin_url);
+ // LOG(INFO) << "---o (" << cache_identifier << ") "
+ // << url.GetString() << "='" << origin_url << "'";
+ // return cache_identifier;
+ // }
+ return MemoryCache::DefaultCacheIdentifier();
@@ -231,7 +237,7 @@ diff --git a/third_party/blink/renderer/platform/loader/fetch/resource_fetcher.c
}
// Requests that can be satisfied via `archive_` (i.e. MHTML) or
@@ -2922,7 +2955,7 @@ String ResourceFetcher::GetCacheIdentifier(const KURL& url,
@@ -2922,7 +2961,7 @@ String ResourceFetcher::GetCacheIdentifier(const KURL& url,
return bundle->GetCacheIdentifier();
}