Cached Page and Frame don't need to be ref-counted.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Sep 2013 21:25:32 +0000 (21:25 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Sep 2013 21:25:32 +0000 (21:25 +0000)
commit49ca9c96c4b391fc2d9e5284c1ee00bd69d17237
tree5d9dbd15af6493073da23d4f26d50fdf98577c40
parent121904f030a890fe26a03b23b92324c7f614d91d
Cached Page and Frame don't need to be ref-counted.
<https://webkit.org/b/120710>

Reviewed by Anders Carlsson.

- CachedPage is owned by HistoryItem.
- CachedFrame is owned by CachedPage.

Remove the ref counting from these objects to make the code less confusing.

Added a new method:

- PassOwnPtr<CachedPage> PageCache::take(HistoryItem*)

..which is what it looks like - a combined get() and remove() that transfers
ownership of the CachedPage to the caller.

This is used by commitProvisionalLoad() and invalidateCurrentItemCachedPage()
to accomplish in one swoop what they used to do in awkwardly spaced steps.

* history/CachedFrame.h:
(WebCore::CachedFrame::create):
* history/CachedPage.cpp:
(WebCore::CachedPage::create):
* history/CachedPage.h:
* history/HistoryItem.h:
* history/PageCache.cpp:
(WebCore::PageCache::take):
* history/PageCache.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::transitionToCommitted):
* loader/FrameLoader.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::invalidateCurrentItemCachedPage):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/history/CachedFrame.h
Source/WebCore/history/CachedPage.cpp
Source/WebCore/history/CachedPage.h
Source/WebCore/history/HistoryItem.h
Source/WebCore/history/PageCache.cpp
Source/WebCore/history/PageCache.h
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/FrameLoader.h
Source/WebCore/loader/HistoryController.cpp