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

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

Issue 2775533003: FrameFetchContext should handle all FrameLoadTypes (Closed)
Patch Set: adopt great renaming in comments Created 3 years, 8 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 | third_party/WebKit/public/web/WebFrameLoadType.h » ('j') | 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 c76c035d6a8a55018be956d5d2a2b08e98bcf51d..bb6009d7db655b3adb229c7bcef2e868bbe962c8 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -223,36 +223,21 @@ enum class ResourceType { kIsMainResource, kIsNotMainResource };
// Determines WebCachePolicy for a main resource, or WebCachePolicy that is
// corresponding to FrameLoadType.
// TODO(toyoshim): Probably, we should split FrameLoadType to WebCachePolicy
-// conversion logic into a separate function once other TODOs in this function
-// are resolved.
+// conversion logic into a separate function.
WebCachePolicy DetermineWebCachePolicy(RequestMethod method,
RequestType request_type,
ResourceType resource_type,
FrameLoadType load_type) {
switch (load_type) {
case kFrameLoadTypeStandard:
- return (request_type == RequestType::kIsConditional ||
- method == RequestMethod::kIsPost)
- ? WebCachePolicy::kValidatingCacheData
- : WebCachePolicy::kUseProtocolCachePolicy;
case kFrameLoadTypeReplaceCurrentItem:
case kFrameLoadTypeInitialInChildFrame:
- // TODO(toyoshim): Should be the same with FrameLoadTypeStandard, but
- // keep legacy logic as is. To be changed in a follow-up patch soon.
- return (resource_type == ResourceType::kIsMainResource &&
- (request_type == RequestType::kIsConditional ||
- method == RequestMethod::kIsPost))
- ? WebCachePolicy::kValidatingCacheData
- : WebCachePolicy::kUseProtocolCachePolicy;
- case kFrameLoadTypeInitialHistoryLoad:
- // TODO(toyoshim): Should be the same with FrameLoadTypeBackForward, but
- // keep legacy logic as is. To be changed in a follow-up patch soon.
- return (resource_type == ResourceType::kIsMainResource &&
- (request_type == RequestType::kIsConditional ||
- method == RequestMethod::kIsPost))
+ return (request_type == RequestType::kIsConditional ||
+ method == RequestMethod::kIsPost)
? WebCachePolicy::kValidatingCacheData
: WebCachePolicy::kUseProtocolCachePolicy;
case kFrameLoadTypeBackForward:
+ case kFrameLoadTypeInitialHistoryLoad:
// Mutates the policy for POST requests to avoid form resubmission.
return method == RequestMethod::kIsPost
? WebCachePolicy::kReturnCacheDataDontLoad
« no previous file with comments | « no previous file | third_party/WebKit/public/web/WebFrameLoadType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698