Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp

Issue 2509533002: Do not add a Resource with DoNotBufferData policy to the memory cache (Closed)
Patch Set: fix Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
index 8c5fbea3b7acbaf24b5ff48310298d3fbbfb94ed..9713e4ab261e94ba38788bb0533eca38e912b11a 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
@@ -744,9 +744,12 @@ Resource* ResourceFetcher::createResourceForLoading(
}
resource->setCacheIdentifier(cacheIdentifier);
- // Don't add main resource to cache to prevent reuse.
- if (factory.type() != Resource::MainResource)
+ // - Don't add main resource to cache to prevent reuse.
+ // - Don't add the resource if its body will not be stored.
+ if (factory.type() != Resource::MainResource &&
+ request.options().dataBufferingPolicy != DoNotBufferData) {
memoryCache()->add(resource);
+ }
return resource;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698