Diff
Modified: trunk/Source/WebCore/ChangeLog (177646 => 177647)
--- trunk/Source/WebCore/ChangeLog 2014-12-22 20:13:02 UTC (rev 177646)
+++ trunk/Source/WebCore/ChangeLog 2014-12-22 20:13:07 UTC (rev 177647)
@@ -1,3 +1,25 @@
+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:
+
2014-12-22 Antti Koivisto <[email protected]>
Try to fix the windows build.
Modified: trunk/Source/WebCore/history/PageCache.cpp (177646 => 177647)
--- trunk/Source/WebCore/history/PageCache.cpp 2014-12-22 20:13:02 UTC (rev 177646)
+++ trunk/Source/WebCore/history/PageCache.cpp 2014-12-22 20:13:07 UTC (rev 177647)
@@ -451,7 +451,7 @@
prune();
}
-std::unique_ptr<CachedPage> PageCache::take(HistoryItem* item)
+std::unique_ptr<CachedPage> PageCache::take(HistoryItem* item, Page* page)
{
if (!item)
return nullptr;
@@ -468,25 +468,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: trunk/Source/WebCore/history/PageCache.h (177646 => 177647)
--- trunk/Source/WebCore/history/PageCache.h 2014-12-22 20:13:02 UTC (rev 177646)
+++ trunk/Source/WebCore/history/PageCache.h 2014-12-22 20:13:07 UTC (rev 177647)
@@ -50,8 +50,8 @@
void add(PassRefPtr<HistoryItem>, Page&); // Prunes if capacity() is exceeded.
WEBCORE_EXPORT 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; }
WEBCORE_EXPORT int frameCount() const;
Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (177646 => 177647)
--- trunk/Source/WebCore/loader/FrameLoader.cpp 2014-12-22 20:13:02 UTC (rev 177646)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp 2014-12-22 20:13:07 UTC (rev 177647)
@@ -1749,7 +1749,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() : "",
@@ -3175,7 +3175,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())) {
auto documentLoader = cachedPage->documentLoader();
documentLoader->setTriggeringAction(NavigationAction(documentLoader->request(), loadType, false));
documentLoader->setLastCheckedRequest(ResourceRequest());
Modified: trunk/Source/WebCore/loader/HistoryController.cpp (177646 => 177647)
--- trunk/Source/WebCore/loader/HistoryController.cpp 2014-12-22 20:13:02 UTC (rev 177646)
+++ trunk/Source/WebCore/loader/HistoryController.cpp 2014-12-22 20:13:07 UTC (rev 177647)
@@ -235,10 +235,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: trunk/Source/WebCore/platform/FeatureCounterKeys.h (177646 => 177647)
--- trunk/Source/WebCore/platform/FeatureCounterKeys.h 2014-12-22 20:13:02 UTC (rev 177646)
+++ trunk/Source/WebCore/platform/FeatureCounterKeys.h 2014-12-22 20:13:07 UTC (rev 177647)
@@ -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";