diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/history')
7 files changed, 38 insertions, 7 deletions
diff --git a/src/3rdparty/webkit/WebCore/history/BackForwardList.cpp b/src/3rdparty/webkit/WebCore/history/BackForwardList.cpp index 1b7c80e..a0636b5 100644 --- a/src/3rdparty/webkit/WebCore/history/BackForwardList.cpp +++ b/src/3rdparty/webkit/WebCore/history/BackForwardList.cpp @@ -266,11 +266,10 @@ bool BackForwardList::containsItem(HistoryItem* entry) } #if ENABLE(WML) -void BackForwardList::clearWmlPageHistory() +void BackForwardList::clearWMLPageHistory() { - PassRefPtr<HistoryItem> cur = currentItem(); - - for (unsigned i = 0; i < m_entries.size(); ++i) + int size = m_entries.size(); + for (int i = 0; i < size; ++i) pageCache()->remove(m_entries[i].get()); m_entries.clear(); diff --git a/src/3rdparty/webkit/WebCore/history/BackForwardList.h b/src/3rdparty/webkit/WebCore/history/BackForwardList.h index a99d387..fdc3360 100644 --- a/src/3rdparty/webkit/WebCore/history/BackForwardList.h +++ b/src/3rdparty/webkit/WebCore/history/BackForwardList.h @@ -97,7 +97,7 @@ public: HistoryItemVector& entries(); #if ENABLE(WML) - void clearWmlPageHistory(); + void clearWMLPageHistory(); #endif private: diff --git a/src/3rdparty/webkit/WebCore/history/CachedFrame.cpp b/src/3rdparty/webkit/WebCore/history/CachedFrame.cpp index 9a43b9d..5f4e746 100644 --- a/src/3rdparty/webkit/WebCore/history/CachedFrame.cpp +++ b/src/3rdparty/webkit/WebCore/history/CachedFrame.cpp @@ -155,4 +155,13 @@ CachedFramePlatformData* CachedFrame::cachedFramePlatformData() return m_cachedFramePlatformData.get(); } +int CachedFrame::descendantFrameCount() const +{ + int count = m_childFrames.size(); + for (size_t i = 0; i < m_childFrames.size(); ++i) + count += m_childFrames[i]->descendantFrameCount(); + + return count; +} + } // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/history/CachedFrame.h b/src/3rdparty/webkit/WebCore/history/CachedFrame.h index 83c3c3c..0302444 100644 --- a/src/3rdparty/webkit/WebCore/history/CachedFrame.h +++ b/src/3rdparty/webkit/WebCore/history/CachedFrame.h @@ -60,6 +60,8 @@ public: void setCachedFramePlatformData(CachedFramePlatformData*); CachedFramePlatformData* cachedFramePlatformData(); + + int descendantFrameCount() const; private: CachedFrame(Frame*); diff --git a/src/3rdparty/webkit/WebCore/history/HistoryItem.cpp b/src/3rdparty/webkit/WebCore/history/HistoryItem.cpp index e199337..d2b83cf 100644 --- a/src/3rdparty/webkit/WebCore/history/HistoryItem.cpp +++ b/src/3rdparty/webkit/WebCore/history/HistoryItem.cpp @@ -480,7 +480,7 @@ FormData* HistoryItem::formData() bool HistoryItem::isCurrentDocument(Document* doc) const { // FIXME: We should find a better way to check if this is the current document. - return urlString() == doc->url(); + return equalIgnoringRef(url(), doc->url()); } void HistoryItem::mergeAutoCompleteHints(HistoryItem* otherItem) diff --git a/src/3rdparty/webkit/WebCore/history/PageCache.cpp b/src/3rdparty/webkit/WebCore/history/PageCache.cpp index 7c25701..8d04f6f 100644 --- a/src/3rdparty/webkit/WebCore/history/PageCache.cpp +++ b/src/3rdparty/webkit/WebCore/history/PageCache.cpp @@ -63,6 +63,23 @@ void PageCache::setCapacity(int capacity) prune(); } +int PageCache::frameCount() const +{ + int frameCount = 0; + for (HistoryItem* current = m_head; current; current = current->m_next) { + ++frameCount; + ASSERT(current->m_cachedPage); + frameCount += current->m_cachedPage ? current->m_cachedPage->cachedMainFrame()->descendantFrameCount() : 0; + } + + return frameCount; +} + +int PageCache::autoreleasedPageCount() const +{ + return m_autoreleaseSet.size(); +} + void PageCache::add(PassRefPtr<HistoryItem> prpItem, PassRefPtr<CachedPage> cachedPage) { ASSERT(prpItem); diff --git a/src/3rdparty/webkit/WebCore/history/PageCache.h b/src/3rdparty/webkit/WebCore/history/PageCache.h index ad15ab6..607a87d 100644 --- a/src/3rdparty/webkit/WebCore/history/PageCache.h +++ b/src/3rdparty/webkit/WebCore/history/PageCache.h @@ -37,7 +37,7 @@ namespace WebCore { class CachedPage; class HistoryItem; - class PageCache : Noncopyable { + class PageCache : public Noncopyable { public: friend PageCache* pageCache(); @@ -49,6 +49,10 @@ namespace WebCore { CachedPage* get(HistoryItem* item) { return item ? item->m_cachedPage.get() : 0; } void releaseAutoreleasedPagesNow(); + + int pageCount() const { return m_size; } + int frameCount() const; + int autoreleasedPageCount() const; private: typedef HashSet<RefPtr<CachedPage> > CachedPageSet; |