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

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: 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/FrameLoader.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 208b1c540e5eb3ec74590b6b9117d6e78e68bbb0..aface1a5911c278671f41a20ae9e35fa7e787d12 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()) {
Nate Chapin 2015/07/15 18:24:03 This function is no longer recursive. Everything a
dcheng 2015/07/16 06:55:47 Incidentally, is this OK to potentially skip ances
Nate Chapin 2015/07/16 18:05:41 In general, either (1) an iframe load is a navigat
+ 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/FrameLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698