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

Unified Diff: third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp

Issue 2829043002: Move |is_static_data| check down in DetermineRevalidationPolicy (Closed)
Patch Set: rebase Created 3 years, 8 months 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/platform/loader/fetch/ResourceFetcher.cpp
diff --git a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
index bb098793b07793070e476c8ffe62ec73d4bd8ca5..3ad25e0ff2d7ee3901961094d0af9525fee695f2 100644
--- a/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/platform/loader/fetch/ResourceFetcher.cpp
@@ -900,11 +900,7 @@ ResourceFetcher::DetermineRevalidationPolicy(
return kReload;
}
- // If resource was populated from a SubstituteData load or data: url, use it.
- if (is_static_data)
- return kUse;
-
- if (!existing_resource->CanReuse(fetch_params))
+ if (!is_static_data && !existing_resource->CanReuse(fetch_params))
return kReload;
// Certain requests (e.g., XHRs) might have manually set headers that require
@@ -918,18 +914,25 @@ ResourceFetcher::DetermineRevalidationPolicy(
// status code, but for a manual revalidation the response code remains 304.
// In this case, the Resource likely has insufficient context to provide a
// useful cache hit or revalidation. See http://crbug.com/643659
- if (request.IsConditional() ||
- existing_resource->GetResponse().HttpStatusCode() == 304) {
+ if (!is_static_data &&
+ (request.IsConditional() ||
+ existing_resource->GetResponse().HttpStatusCode() == 304)) {
return kReload;
}
- if (!fetch_params.Options().CanReuseRequest(existing_resource->Options()))
+ if (!is_static_data &&
+ !fetch_params.Options().CanReuseRequest(existing_resource->Options())) {
return kReload;
+ }
// Always use preloads.
if (existing_resource->IsPreloaded())
return kUse;
+ // If resource was populated from a SubstituteData load or data: url, use it.
+ if (is_static_data)
+ return kUse;
+
// Don't reload resources while pasting.
if (allow_stale_resources_)
return kUse;
« 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