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

Unified Diff: Source/core/loader/FrameFetchContext.cpp

Issue 1213913003: Don't revalidate all resources for FrameLoadTypeSame (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix oilpan + assert failures Created 5 years, 5 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 | Source/core/loader/FrameFetchContextTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/FrameFetchContext.cpp
diff --git a/Source/core/loader/FrameFetchContext.cpp b/Source/core/loader/FrameFetchContext.cpp
index 8cf3d64d7a1dc9f9d562471d64c1bb3719b3d0d3..34fd9352c511149f23717e83905bf790bbc0693c 100644
--- a/Source/core/loader/FrameFetchContext.cpp
+++ b/Source/core/loader/FrameFetchContext.cpp
@@ -162,15 +162,22 @@ ResourceRequestCachePolicy FrameFetchContext::resourceRequestCachePolicy(const R
FrameLoadType frameLoadType = frame()->loader().loadType();
if (request.httpMethod() == "POST" && frameLoadType == FrameLoadTypeBackForward)
return ReturnCacheDataDontLoad;
- if (!frame()->host()->overrideEncoding().isEmpty() || frameLoadType == FrameLoadTypeBackForward)
+ if (!frame()->host()->overrideEncoding().isEmpty())
return ReturnCacheDataElseLoad;
- if (frameLoadType == FrameLoadTypeReloadFromOrigin)
- return ReloadBypassingCache;
- if (frameLoadType == FrameLoadTypeReload || frameLoadType == FrameLoadTypeSame || request.isConditional() || request.httpMethod() == "POST")
+ if (frameLoadType == FrameLoadTypeSame || request.isConditional() || request.httpMethod() == "POST")
return ReloadIgnoringCacheData;
- Frame* parent = frame()->tree().parent();
- if (parent && parent->isLocalFrame())
- return toLocalFrame(parent)->document()->fetcher()->context().resourceRequestCachePolicy(request, type);
+
+ for (Frame* f = frame(); f; f = f->tree().parent()) {
+ if (!f->isLocalFrame())
+ continue;
+ frameLoadType = toLocalFrame(f)->loader().loadType();
+ if (frameLoadType == FrameLoadTypeBackForward)
+ return ReturnCacheDataElseLoad;
+ if (frameLoadType == FrameLoadTypeReloadFromOrigin)
+ return ReloadBypassingCache;
+ if (frameLoadType == FrameLoadTypeReload)
+ return ReloadIgnoringCacheData;
+ }
return UseProtocolCachePolicy;
}
« no previous file with comments | « no previous file | Source/core/loader/FrameFetchContextTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698