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

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

Issue 2181093004: FrameFetchContext: add clear comments how FrameLoadTypeReloadMainResource works (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
index f873f582a862959088feae2731098e1add6b3b7e..ebfae33123840ce6b0834838cd3cbbdc7a044210 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -218,6 +218,10 @@ CachePolicy FrameFetchContext::getCachePolicy() const
if (m_documentLoader && m_documentLoader->request().getCachePolicy() == WebCachePolicy::ReturnCacheDataElseLoad)
return CachePolicyHistoryBuffer;
+
+ // Returns CachePolicyVerify for other cases, mainly FrameLoadTypeStandard
+ // and FrameLoadTypeReloadMainResource. See public/web/WebFrameLoadType.h
+ // to know how these load types work.
return CachePolicyVerify;
}
@@ -249,14 +253,18 @@ WebCachePolicy FrameFetchContext::resourceRequestCachePolicy(const ResourceReque
for (Frame* f = frame(); f; f = f->tree().parent()) {
if (!f->isLocalFrame())
continue;
- frameLoadType = toLocalFrame(f)->loader().loadType();
- if (frameLoadType == FrameLoadTypeBackForward)
+ FrameLoadType parentFrameLoadType = toLocalFrame(f)->loader().loadType();
+ if (parentFrameLoadType == FrameLoadTypeBackForward)
return WebCachePolicy::ReturnCacheDataElseLoad;
- if (frameLoadType == FrameLoadTypeReloadBypassingCache)
+ if (parentFrameLoadType == FrameLoadTypeReloadBypassingCache)
return WebCachePolicy::BypassingCache;
- if (frameLoadType == FrameLoadTypeReload)
+ if (parentFrameLoadType == FrameLoadTypeReload)
return WebCachePolicy::ValidatingCacheData;
}
+ // Returns UseProtocolCachePolicy for other cases, parent frames not
+ // having special kinds of FrameLoadType as they are checked inside
+ // the for loop above, or |frameLoadType| being FrameLoadTypeStandard.
+ // See public/web/WebFrameLoadType.h to know how these load types work.
return WebCachePolicy::UseProtocolCachePolicy;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698