Implement ApplicationCacheHost::canCacheInPageCache() for chromium.
authorgavinp@chromium.org <gavinp@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Mar 2012 20:47:58 +0000 (20:47 +0000)
committergavinp@chromium.org <gavinp@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Mar 2012 20:47:58 +0000 (20:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=80905

Reviewed by Eric Seidel.

This won't cause chrome to use the PageCache, but it will cause our histogram statistics
describing PageCache use to be more accurate.

* src/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::canCacheInPageCache):

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

Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/ApplicationCacheHost.cpp

index d4e3123..753f943 100644 (file)
@@ -1,3 +1,16 @@
+2012-03-13  Gavin Peters  <gavinp@chromium.org>
+
+        Implement ApplicationCacheHost::canCacheInPageCache() for chromium.
+        https://bugs.webkit.org/show_bug.cgi?id=80905
+
+        Reviewed by Eric Seidel.
+
+        This won't cause chrome to use the PageCache, but it will cause our histogram statistics
+        describing PageCache use to be more accurate.
+
+        * src/ApplicationCacheHost.cpp:
+        (WebCore::ApplicationCacheHost::canCacheInPageCache):
+
 2012-03-13  Dana Jansens  <danakj@chromium.org>
 
         [chromium] Use CCOcclusionTracker for draw culling
index eb0a9ff..bbf740d 100644 (file)
@@ -195,8 +195,10 @@ void ApplicationCacheHost::maybeLoadFallbackSynchronously(const ResourceRequest&
 
 bool ApplicationCacheHost::canCacheInPageCache()
 {
-    // N/A to the chromium port which doesn't use the page cache.
-    return false;
+    // Chromium doesn't use the page cache, however, that's controlled by WebCore::Settings, which has usesPageCache() return
+    // false. So we return an hyptothetical here: Chromium won't end up using the PageCache, but the statistics in PageCache.cpp
+    // will be reported correctly for re-evaluating that decision.
+    return !isApplicationCacheEnabled() || status() == UNCACHED;
 }
 
 void ApplicationCacheHost::setDOMApplicationCache(DOMApplicationCache* domApplicationCache)