Fix ENABLE(NETWORK_CACHE) build
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jan 2015 01:19:20 +0000 (01:19 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Jan 2015 01:19:20 +0000 (01:19 +0000)
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::didFinishLoading):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178973 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/NetworkResourceLoader.cpp

index 45373dd..56d5642 100644 (file)
@@ -1,3 +1,10 @@
+2015-01-22  Antti Koivisto  <antti@apple.com>
+
+        Fix ENABLE(NETWORK_CACHE) build
+
+        * NetworkProcess/NetworkResourceLoader.cpp:
+        (WebKit::NetworkResourceLoader::didFinishLoading):
+
 2015-01-22  Timothy Horton  <timothy_horton@apple.com>
 
         UserData decoding of WKTypeRefWrapper always fails
index 1addae9..bb9f558 100644 (file)
@@ -326,8 +326,8 @@ void NetworkResourceLoader::didFinishLoading(ResourceHandle* handle, double fini
             didRetrieveCacheEntry(WTF::move(m_cacheEntryForValidation));
             return;
         }
-
-        bool hasCacheableRedirect = WebCore::redirectChainAllowsReuse(m_redirectChainCacheStatus);
+        bool allowStale = originalRequest().cachePolicy() >= ReturnCacheDataElseLoad;
+        bool hasCacheableRedirect = WebCore::redirectChainAllowsReuse(m_redirectChainCacheStatus, allowStale ? WebCore::ReuseExpiredRedirection : WebCore::DoNotReuseExpiredRedirection);
         if (hasCacheableRedirect && m_redirectChainCacheStatus.status == RedirectChainCacheStatus::CachedRedirection) {
             // FIXME: Cache the actual redirects instead of the end result.
             double now = currentTime();