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

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

Issue 2167623002: Reload: propagate FrameLoadType to child frames Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add some comments 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
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 830f1ebc75063c5ff64203f9a248c5d957b2c2d2..2014151a9491cc779b0f7d00709d802f32394219 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -120,8 +120,7 @@ bool shouldDisallowFetchForMainFrameScript(const ResourceRequest& request, Fetch
// recover if blocking of a script is leading to a page break and the user
// reloads the page.
const FrameLoadType loadType = document.frame()->loader().loadType();
- const bool isReload = loadType == FrameLoadTypeReload || loadType == FrameLoadTypeReloadBypassingCache || loadType == FrameLoadTypeReloadMainResource;
- if (isReload) {
+ if (isReloadLoadType(loadType)) {
// Recording this metric since an increase in number of reloads for pages
// where a script was blocked could be indicative of a page break.
document.loader()->didObserveLoadingBehavior(WebLoadingBehaviorFlag::WebLoadingBehaviorDocumentWriteBlockReload);
@@ -219,6 +218,9 @@ CachePolicy FrameFetchContext::getCachePolicy() const
if (m_documentLoader && m_documentLoader->request().getCachePolicy() == WebCachePolicy::ReturnCacheDataElseLoad)
return CachePolicyHistoryBuffer;
+
+ // Returning CachePolicyVerify for FrameLoadTypeReloadMainResource is
+ // intentional.
hiroshige 2016/07/26 07:37:17 Not blocking this CL, but do we have any documents
Takashi Toyoshima 2016/07/26 08:14:20 How about public/web/WebFrameLoadType.h? core/load
return CachePolicyVerify;
}
@@ -258,6 +260,8 @@ WebCachePolicy FrameFetchContext::resourceRequestCachePolicy(const ResourceReque
if (frameLoadType == FrameLoadTypeReload)
return WebCachePolicy::ValidatingCacheData;
}
+ // Returning UseProtocolCachePolicy for FrameLoadTypeReloadMainResource
+ // is intentional.
hiroshige 2016/07/26 07:37:17 ditto.
return WebCachePolicy::UseProtocolCachePolicy;
}

Powered by Google App Engine
This is Rietveld 408576698