| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |