Commit 58197789 authored by yhirano's avatar yhirano Committed by Commit bot

Move |is_static_data| check down in DetermineRevalidationPolicy

This CL moves

 if (is_static_data)
   return kUse;

section down in DetermineRevalidationPolicy as a preparation to factor out some
|return kReload;| statements.

BUG=652228, 714574
R=hiroshige@chromium.org

Review-Url: https://codereview.chromium.org/2829043002
Cr-Commit-Position: refs/heads/master@{#466931}
parent 0363d88c
......@@ -897,11 +897,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
......@@ -915,18 +911,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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment