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; |