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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameFetchContext.cpp

Issue 2768293002: FrameFetchContext should respect BypassingCache (Closed)
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 case FrameLoadTypeBackForward: 250 case FrameLoadTypeBackForward:
251 // Mutates the policy for POST requests to avoid form resubmission. 251 // Mutates the policy for POST requests to avoid form resubmission.
252 return method == RequestMethod::kIsPost 252 return method == RequestMethod::kIsPost
253 ? WebCachePolicy::ReturnCacheDataDontLoad 253 ? WebCachePolicy::ReturnCacheDataDontLoad
254 : WebCachePolicy::ReturnCacheDataElseLoad; 254 : WebCachePolicy::ReturnCacheDataElseLoad;
255 case FrameLoadTypeReload: 255 case FrameLoadTypeReload:
256 return resourceType == ResourceType::kIsMainResource 256 return resourceType == ResourceType::kIsMainResource
257 ? WebCachePolicy::ValidatingCacheData 257 ? WebCachePolicy::ValidatingCacheData
258 : WebCachePolicy::UseProtocolCachePolicy; 258 : WebCachePolicy::UseProtocolCachePolicy;
259 case FrameLoadTypeReloadBypassingCache: 259 case FrameLoadTypeReloadBypassingCache:
260 // TODO(toyoshim): Should return BypassingCache always, but keep legacy 260 return WebCachePolicy::BypassingCache;
261 // logic as is. To be changed in a follow-up patch soon.
262 return (resourceType == ResourceType::kIsMainResource &&
263 (requestType == RequestType::kIsConditional ||
264 method == RequestMethod::kIsPost))
265 ? WebCachePolicy::ValidatingCacheData
266 : WebCachePolicy::BypassingCache;
267 } 261 }
268 NOTREACHED(); 262 NOTREACHED();
269 return WebCachePolicy::UseProtocolCachePolicy; 263 return WebCachePolicy::UseProtocolCachePolicy;
270 } 264 }
271 265
272 // TODO(toyoshim): Remove |resourceType|. See comments in 266 // TODO(toyoshim): Remove |resourceType|. See comments in
273 // resourceRequestCachePolicy(). 267 // resourceRequestCachePolicy().
274 WebCachePolicy determineFrameWebCachePolicy(Frame* frame, 268 WebCachePolicy determineFrameWebCachePolicy(Frame* frame,
275 ResourceType resourceType) { 269 ResourceType resourceType) {
276 if (!frame) 270 if (!frame)
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 return frame()->frameScheduler()->loadingTaskRunner(); 1048 return frame()->frameScheduler()->loadingTaskRunner();
1055 } 1049 }
1056 1050
1057 DEFINE_TRACE(FrameFetchContext) { 1051 DEFINE_TRACE(FrameFetchContext) {
1058 visitor->trace(m_document); 1052 visitor->trace(m_document);
1059 visitor->trace(m_documentLoader); 1053 visitor->trace(m_documentLoader);
1060 FetchContext::trace(visitor); 1054 FetchContext::trace(visitor);
1061 } 1055 }
1062 1056
1063 } // namespace blink 1057 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/loader/FrameFetchContextTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698