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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 return WebCachePolicy::UseProtocolCachePolicy; | 252 return WebCachePolicy::UseProtocolCachePolicy; |
253 } | 253 } |
254 | 254 |
255 WebCachePolicy FrameFetchContext::resourceRequestCachePolicy(const ResourceReque
st& request, Resource::Type type, FetchRequest::DeferOption defer) const | 255 WebCachePolicy FrameFetchContext::resourceRequestCachePolicy(const ResourceReque
st& request, Resource::Type type, FetchRequest::DeferOption defer) const |
256 { | 256 { |
257 ASSERT(frame()); | 257 ASSERT(frame()); |
258 if (type == Resource::MainResource) { | 258 if (type == Resource::MainResource) { |
259 FrameLoadType frameLoadType = frame()->loader().loadType(); | 259 FrameLoadType frameLoadType = frame()->loader().loadType(); |
260 if (request.httpMethod() == "POST" && frameLoadType == FrameLoadTypeBack
Forward) | 260 if (request.httpMethod() == "POST" && frameLoadType == FrameLoadTypeBack
Forward) |
261 return WebCachePolicy::ReturnCacheDataDontLoad; | 261 return WebCachePolicy::ReturnCacheDataDontLoad; |
262 if (!frame()->host()->overrideEncoding().isEmpty()) | |
263 return WebCachePolicy::ReturnCacheDataElseLoad; | |
264 if (frameLoadType == FrameLoadTypeReloadMainResource || request.isCondit
ional() || request.httpMethod() == "POST") | 262 if (frameLoadType == FrameLoadTypeReloadMainResource || request.isCondit
ional() || request.httpMethod() == "POST") |
265 return WebCachePolicy::ValidatingCacheData; | 263 return WebCachePolicy::ValidatingCacheData; |
266 | 264 |
267 for (Frame* f = frame(); f; f = f->tree().parent()) { | 265 for (Frame* f = frame(); f; f = f->tree().parent()) { |
268 if (!f->isLocalFrame()) | 266 if (!f->isLocalFrame()) |
269 continue; | 267 continue; |
270 FrameLoadType parentFrameLoadType = toLocalFrame(f)->loader().loadTy
pe(); | 268 FrameLoadType parentFrameLoadType = toLocalFrame(f)->loader().loadTy
pe(); |
271 if (parentFrameLoadType == FrameLoadTypeBackForward) | 269 if (parentFrameLoadType == FrameLoadTypeBackForward) |
272 return WebCachePolicy::ReturnCacheDataElseLoad; | 270 return WebCachePolicy::ReturnCacheDataElseLoad; |
273 if (parentFrameLoadType == FrameLoadTypeReloadBypassingCache) | 271 if (parentFrameLoadType == FrameLoadTypeReloadBypassingCache) |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 } | 829 } |
832 | 830 |
833 DEFINE_TRACE(FrameFetchContext) | 831 DEFINE_TRACE(FrameFetchContext) |
834 { | 832 { |
835 visitor->trace(m_document); | 833 visitor->trace(m_document); |
836 visitor->trace(m_documentLoader); | 834 visitor->trace(m_documentLoader); |
837 FetchContext::trace(visitor); | 835 FetchContext::trace(visitor); |
838 } | 836 } |
839 | 837 |
840 } // namespace blink | 838 } // namespace blink |
OLD | NEW |