Chromium Code Reviews

Side by Side Diff: third_party/WebKit/Source/core/fetch/Resource.cpp

Issue 2044483002: Do not initiate revalidation of Resource with redirects from MemoryCache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « no previous file | no next file » | 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) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) 5 Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 6 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 942 matching lines...)
953 return !canUseResponse(m_response, m_responseTimestamp) || m_resourceRequest .cacheControlContainsNoCache() || m_resourceRequest.cacheControlContainsNoStore( ); 953 return !canUseResponse(m_response, m_responseTimestamp) || m_resourceRequest .cacheControlContainsNoCache() || m_resourceRequest.cacheControlContainsNoStore( );
954 } 954 }
955 955
956 bool Resource::canUseCacheValidator() 956 bool Resource::canUseCacheValidator()
957 { 957 {
958 if (isLoading() || errorOccurred()) 958 if (isLoading() || errorOccurred())
959 return false; 959 return false;
960 960
961 if (hasCacheControlNoStoreHeader()) 961 if (hasCacheControlNoStoreHeader())
962 return false; 962 return false;
963
964 // Do not revalidate Resource with redirects. https://crbug.com/613971
965 if (!redirectChain().isEmpty())
966 return false;
967
963 return m_response.hasCacheValidatorFields() || m_resourceRequest.hasCacheVal idatorFields(); 968 return m_response.hasCacheValidatorFields() || m_resourceRequest.hasCacheVal idatorFields();
964 } 969 }
965 970
966 bool Resource::isPurgeable() const 971 bool Resource::isPurgeable() const
967 { 972 {
968 return m_data && !m_data->isLocked(); 973 return m_data && !m_data->isLocked();
969 } 974 }
970 975
971 bool Resource::lock() 976 bool Resource::lock()
972 { 977 {
(...skipping 149 matching lines...)
1122 case Resource::Media: 1127 case Resource::Media:
1123 return "Media"; 1128 return "Media";
1124 case Resource::Manifest: 1129 case Resource::Manifest:
1125 return "Manifest"; 1130 return "Manifest";
1126 } 1131 }
1127 ASSERT_NOT_REACHED(); 1132 ASSERT_NOT_REACHED();
1128 return "Unknown"; 1133 return "Unknown";
1129 } 1134 }
1130 1135
1131 } // namespace blink 1136 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine