Commit 0b168808 authored by yhirano's avatar yhirano Committed by Commit bot

Give |allow_stale_resources_| a lower priority in DetermineRevalidationPolicy

This CL changes DetermineRevalidationPolicy a bit to simplify it. With this
CL, |allow_stale_resources_| will be checked after
ResourceLoaderOptions::CanReuseRequest is checked. CanReuseRequest checks
the synchronous policy and the cors policy, and neither of them is related
to staleness. Moreover, the synchronous policy was once checked BEFORE
allow_stale_resources_ (see [1]). Also, any user of
ResourceCacheValidationSuppressor, the class used to enable
|allow_stale_resource_|, doesn't seem to be interested in CORS. Hence I expect
no behavior change from this CL.

1: https://crrev.com/733a476495c43c1f472e5770c9d8aeeb94c5caca

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

Review-Url: https://codereview.chromium.org/2828243002
Cr-Commit-Position: refs/heads/master@{#466880}
parent e88b030f
......@@ -923,10 +923,6 @@ ResourceFetcher::DetermineRevalidationPolicy(
return kReload;
}
// Don't reload resources while pasting.
if (allow_stale_resources_)
return kUse;
if (!fetch_params.Options().CanReuseRequest(existing_resource->Options()))
return kReload;
......@@ -934,6 +930,10 @@ ResourceFetcher::DetermineRevalidationPolicy(
if (existing_resource->IsPreloaded())
return kUse;
// Don't reload resources while pasting.
if (allow_stale_resources_)
return kUse;
// WebCachePolicy::ReturnCacheDataElseLoad uses the cache no matter what.
if (request.GetCachePolicy() == WebCachePolicy::kReturnCacheDataElseLoad)
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