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

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

Issue 2771803002: FrameFetchContext should not always respect conditional requests (Closed)
Patch Set: Created 3 years, 9 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 5f8ca3e28039e6fc019e2d530e25f246699ca152..d8bd3d25cd0e19239f493aa7807dc8748a6afce4 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -415,13 +415,14 @@ WebCachePolicy FrameFetchContext::resourceRequestCachePolicy(
shouldDisallowFetchForMainFrameScript(request, defer, *m_document))
return WebCachePolicy::ReturnCacheDataDontLoad;
- // TODO(toyoshim): We should check isConditional() and use ValidatingCacheData
- // only when |cachePolicy| below is UseProtocolCachePolicy.
- if (request.isConditional())
- return WebCachePolicy::ValidatingCacheData;
+ const WebCachePolicy cachePolicy =
+ determineFrameWebCachePolicy(frame(), ResourceType::kIsNotMainResource);
- return determineFrameWebCachePolicy(frame(),
- ResourceType::kIsNotMainResource);
+ if (cachePolicy == WebCachePolicy::UseProtocolCachePolicy &&
+ request.isConditional()) {
Nate Chapin 2017/03/28 21:45:54 Hmm...one other thought. Can this clause be merged
Takashi Toyoshima 2017/03/29 10:56:17 Currently, determineWCP requires many parameters t
+ return WebCachePolicy::ValidatingCacheData;
+ }
+ return cachePolicy;
}
// The |m_documentLoader| is null in the FrameFetchContext of an imported
« 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