[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

mjs at apple.com mjs at apple.com
Thu Feb 4 21:25:35 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit c5465da80954996d03dfc8bc3f826c3027a3406a
Author: mjs at apple.com <mjs at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Jan 23 00:43:37 2010 +0000

    2010-01-22  Maciej Stachowiak  <mjs at apple.com>
    
            Reviewed by Adam Roben.
    
            Use stale cache data when going back and forward but not using WebCore’s page cache
            https://bugs.webkit.org/show_bug.cgi?id=33993
            <rdar://problem/7383392>
    
            No tests since this is a performance change.
    
            * loader/CachePolicy.h:
            (WebCore::): Add CachePolicyAllowStale.
            * loader/DocLoader.cpp:
            (WebCore::DocLoader::checkForReload): Never reload in the case of
            CachePolicyAllowStale.
            * loader/FrameLoader.cpp:
            (WebCore::FrameLoader::subresourceCachePolicy): Return CachePolicyAllowStale
            if the main resource is being loaded to allow stale data.
            (WebCore::FrameLoader::addExtraFieldsToRequest): Use ReturnCacheDataElseLoad
            on back/forward loads - needed when going back of forward to a page with frames.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53737 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 2c38200..536e598 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2010-01-22  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by Adam Roben.
+
+        Use stale cache data when going back and forward but not using WebCore’s page cache
+        https://bugs.webkit.org/show_bug.cgi?id=33993
+        <rdar://problem/7383392>
+
+        No tests since this is a performance change.
+
+        * loader/CachePolicy.h:
+        (WebCore::): Add CachePolicyAllowStale.
+        * loader/DocLoader.cpp:
+        (WebCore::DocLoader::checkForReload): Never reload in the case of
+        CachePolicyAllowStale.
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::subresourceCachePolicy): Return CachePolicyAllowStale
+        if the main resource is being loaded to allow stale data.
+        (WebCore::FrameLoader::addExtraFieldsToRequest): Use ReturnCacheDataElseLoad
+        on back/forward loads - needed when going back of forward to a page with frames.
+
 2010-01-22  Kelly Norton  <knorton at google.com>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/loader/CachePolicy.h b/WebCore/loader/CachePolicy.h
index 93f92b1..2639caa 100644
--- a/WebCore/loader/CachePolicy.h
+++ b/WebCore/loader/CachePolicy.h
@@ -32,7 +32,8 @@ namespace WebCore {
         CachePolicyCache,
         CachePolicyVerify,
         CachePolicyRevalidate,
-        CachePolicyReload
+        CachePolicyReload,
+        CachePolicyAllowStale
     };
 
 }
diff --git a/WebCore/loader/DocLoader.cpp b/WebCore/loader/DocLoader.cpp
index 5eb7acf..c34f81b 100644
--- a/WebCore/loader/DocLoader.cpp
+++ b/WebCore/loader/DocLoader.cpp
@@ -111,8 +111,8 @@ void DocLoader::checkForReload(const KURL& fullURL)
     case CachePolicyRevalidate:
         cache()->revalidateResource(existing, this);
         break;
-    default:
-        ASSERT_NOT_REACHED();
+    case CachePolicyAllowStale:
+        return;
     }
 
     m_reloadedURLs.add(fullURL.string());
diff --git a/WebCore/loader/FrameLoader.cpp b/WebCore/loader/FrameLoader.cpp
index 28cee79..415f28f 100644
--- a/WebCore/loader/FrameLoader.cpp
+++ b/WebCore/loader/FrameLoader.cpp
@@ -2902,6 +2902,9 @@ CachePolicy FrameLoader::subresourceCachePolicy() const
     if (m_loadType == FrameLoadTypeReload)
         return CachePolicyRevalidate;
 
+    if (request.cachePolicy() == ReturnCacheDataElseLoad)
+        return CachePolicyAllowStale;
+
     return CachePolicyVerify;
 }
 
@@ -3219,7 +3222,8 @@ void FrameLoader::addExtraFieldsToRequest(ResourceRequest& request, FrameLoadTyp
         request.setCachePolicy(ReloadIgnoringCacheData);
         request.setHTTPHeaderField("Cache-Control", "no-cache");
         request.setHTTPHeaderField("Pragma", "no-cache");
-    }
+    } else if (isBackForwardLoadType(loadType) && !request.url().protocolIs("https"))
+        request.setCachePolicy(ReturnCacheDataElseLoad);
     
     if (mainResource)
         request.setHTTPAccept(defaultAcceptHeader);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list