Title: [179224] branches/safari-600.1.4.15-branch/Source/WebCore

Diff

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog (179223 => 179224)


--- branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog	2015-01-27 22:56:00 UTC (rev 179223)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/ChangeLog	2015-01-27 23:34:51 UTC (rev 179224)
@@ -1,5 +1,31 @@
 2015-01-27  Lucas Forschler  <[email protected]>
 
+        Merge r177647
+
+    2014-12-22  Chris Dumez  <[email protected]>
+
+            [iOS] Log using FeatureCounter when a PacheCache entry is not reused because it expired
+            https://bugs.webkit.org/show_bug.cgi?id=139869
+            <rdar://problem/19255690>
+
+            Reviewed by Darin Adler.
+
+            Log using FeatureCounter when a PacheCache entry is not reused because
+            it expired.
+
+            * history/PageCache.cpp:
+            (WebCore::PageCache::take):
+            (WebCore::PageCache::get):
+            * history/PageCache.h:
+            * loader/FrameLoader.cpp:
+            (WebCore::FrameLoader::commitProvisionalLoad):
+            (WebCore::FrameLoader::loadDifferentDocumentItem):
+            * loader/HistoryController.cpp:
+            (WebCore::HistoryController::invalidateCurrentItemCachedPage):
+            * platform/FeatureCounterKeys.h:
+
+2015-01-27  Lucas Forschler  <[email protected]>
+
         Merge r177591
 
     2014-12-19  Chris Dumez  <[email protected]>

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/history/PageCache.cpp (179223 => 179224)


--- branches/safari-600.1.4.15-branch/Source/WebCore/history/PageCache.cpp	2015-01-27 22:56:00 UTC (rev 179223)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/history/PageCache.cpp	2015-01-27 23:34:51 UTC (rev 179224)
@@ -464,7 +464,7 @@
     prune();
 }
 
-std::unique_ptr<CachedPage> PageCache::take(HistoryItem* item)
+std::unique_ptr<CachedPage> PageCache::take(HistoryItem* item, Page* page)
 {
     if (!item)
         return nullptr;
@@ -481,25 +481,27 @@
 
     if (cachedPage->hasExpired()) {
         LOG(PageCache, "Not restoring page for %s from back/forward cache because cache entry has expired", item->url().string().ascii().data());
+        FEATURE_COUNTER_INCREMENT_KEY(page, FeatureCounterPageCacheFailureExpiredKey);
         return nullptr;
     }
 
     return cachedPage;
 }
 
-CachedPage* PageCache::get(HistoryItem* item)
+CachedPage* PageCache::get(HistoryItem* item, Page* page)
 {
     if (!item)
-        return 0;
+        return nullptr;
 
     if (CachedPage* cachedPage = item->m_cachedPage.get()) {
         if (!cachedPage->hasExpired())
             return cachedPage;
         
         LOG(PageCache, "Not restoring page for %s from back/forward cache because cache entry has expired", item->url().string().ascii().data());
+        FEATURE_COUNTER_INCREMENT_KEY(page, FeatureCounterPageCacheFailureExpiredKey);
         pageCache()->remove(item);
     }
-    return 0;
+    return nullptr;
 }
 
 void PageCache::remove(HistoryItem* item)

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/history/PageCache.h (179223 => 179224)


--- branches/safari-600.1.4.15-branch/Source/WebCore/history/PageCache.h	2015-01-27 22:56:00 UTC (rev 179223)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/history/PageCache.h	2015-01-27 23:34:51 UTC (rev 179224)
@@ -50,8 +50,8 @@
         
         void add(PassRefPtr<HistoryItem>, Page&); // Prunes if capacity() is exceeded.
         void remove(HistoryItem*);
-        CachedPage* get(HistoryItem* item);
-        std::unique_ptr<CachedPage> take(HistoryItem*);
+        CachedPage* get(HistoryItem*, Page*);
+        std::unique_ptr<CachedPage> take(HistoryItem*, Page*);
 
         int pageCount() const { return m_size; }
         int frameCount() const;

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/loader/FrameLoader.cpp (179223 => 179224)


--- branches/safari-600.1.4.15-branch/Source/WebCore/loader/FrameLoader.cpp	2015-01-27 22:56:00 UTC (rev 179223)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/loader/FrameLoader.cpp	2015-01-27 23:34:51 UTC (rev 179224)
@@ -1792,7 +1792,7 @@
 
     std::unique_ptr<CachedPage> cachedPage;
     if (m_loadingFromCachedPage)
-        cachedPage = pageCache()->take(history().provisionalItem());
+        cachedPage = pageCache()->take(history().provisionalItem(), m_frame.page());
 
     LOG(PageCache, "WebCoreLoading %s: About to commit provisional load from previous URL '%s' to new URL '%s'", m_frame.tree().uniqueName().string().utf8().data(),
         m_frame.document() ? m_frame.document()->url().stringCenterEllipsizedToLength().utf8().data() : "",
@@ -3198,7 +3198,7 @@
     // Remember this item so we can traverse any child items as child frames load
     history().setProvisionalItem(item);
 
-    if (CachedPage* cachedPage = pageCache()->get(item)) {
+    if (CachedPage* cachedPage = pageCache()->get(item, m_frame.page())) {
         loadWithDocumentLoader(cachedPage->documentLoader(), loadType, 0);   
         return;
     }

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/loader/HistoryController.cpp (179223 => 179224)


--- branches/safari-600.1.4.15-branch/Source/WebCore/loader/HistoryController.cpp	2015-01-27 22:56:00 UTC (rev 179223)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/loader/HistoryController.cpp	2015-01-27 23:34:51 UTC (rev 179224)
@@ -234,10 +234,10 @@
 void HistoryController::invalidateCurrentItemCachedPage()
 {
     // When we are pre-commit, the currentItem is where any page cache data resides.
-    if (!pageCache()->get(currentItem()))
+    if (!pageCache()->get(currentItem(), m_frame.page()))
         return;
 
-    std::unique_ptr<CachedPage> cachedPage = pageCache()->take(currentItem());
+    std::unique_ptr<CachedPage> cachedPage = pageCache()->take(currentItem(), m_frame.page());
 
     // FIXME: This is a grotesque hack to fix <rdar://problem/4059059> Crash in RenderFlow::detach
     // Somehow the PageState object is not properly updated, and is holding onto a stale document.

Modified: branches/safari-600.1.4.15-branch/Source/WebCore/platform/FeatureCounterKeys.h (179223 => 179224)


--- branches/safari-600.1.4.15-branch/Source/WebCore/platform/FeatureCounterKeys.h	2015-01-27 22:56:00 UTC (rev 179223)
+++ branches/safari-600.1.4.15-branch/Source/WebCore/platform/FeatureCounterKeys.h	2015-01-27 23:34:51 UTC (rev 179224)
@@ -58,6 +58,7 @@
 static const char FeatureCounterPageCacheFailureReloadKey[] = "com.apple.WebKit.pageCache.failure.reload";
 static const char FeatureCounterPageCacheFailureReloadFromOriginKey[] = "com.apple.WebKit.pageCache.failure.reloadFromOrigin";
 static const char FeatureCounterPageCacheFailureSameLoadKey[] = "com.apple.WebKit.pageCache.failure.sameLoad";
+static const char FeatureCounterPageCacheFailureExpiredKey[] = "com.apple.WebKit.pageCache.failure.expired";
 static const char FeatureCounterPageCacheFailureKey[] = "com.apple.WebKit.pageCache.failure";
 static const char FeatureCounterPageCacheSuccessKey[] = "com.apple.WebKit.pageCache.success";
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to