Clean up / modernize PageCache class
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Jan 2015 18:38:51 +0000 (18:38 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 Jan 2015 18:38:51 +0000 (18:38 +0000)
commitc6589caa01ae04dda7f5314f1617fda50a2673c4
tree8807985880c295f216a9dfeca28fff63f9635206
parent67f7ae020478cf40ddb9c9928137a20f2a923c03
Clean up / modernize PageCache class
https://bugs.webkit.org/show_bug.cgi?id=141009

Reviewed by Darin Adler.

Source/WebCore:

Clean up / modernize PageCache class:
- Use more references instead of pointers
- Use a ListHashSet<Ref<HistoryItem>> internally instead of a linked
  list of HistoryItem*. This avoids having the ref/unref HistoryItems
  manually and maintaining the list size separately. It also simplifies
  the code dealing with the container and makes looking up HistoryItems
  faster as a bonus. Similarly to the previous implementation, we are
  adding elements to one end and removing from the opposite end when
  pruning to drop old history items first. Note that even though the
  previous implementation was called LRUList, it did not move items to
  the front when accessed. The new implementation doesn't either.
 - Rename "capacity" to "maxSize" to avoid confusing with containers'
   capacity (which doesn't limit the size of the container).
 - Use unsigned instead of int for all values that are supposed to be
   positive.
 - Do not explicitely define the default constructor and let the
   compiler generate it for us (and use in-class initialization for
   members)
 - Fix indentation in the header.

Source/WebKit/mac:

Clean up / modernize PageCache class.

* History/WebBackForwardList.mm:
(-[WebBackForwardList pageCacheSize]):
* WebView/WebView.mm:
(-[WebView _loadBackForwardListFromOtherView:]):
(-[WebView goToBackForwardItem:]):
(+[WebView _setCacheModel:]):

Source/WebKit/win:

Clean up / modernize PageCache class.

* WebView.cpp:
(WebView::setCacheModel):

Source/WebKit2:

Clean up / modernize PageCache class.

* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::removeItem):
(WebKit::WebBackForwardListProxy::close):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::goForward):
(WebKit::WebPage::goBack):
(WebKit::WebPage::goToBackForwardItem):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::releasePageCache):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformSetCacheModel):
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformSetCacheModel):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@179347 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/history/BackForwardController.cpp
Source/WebCore/history/BackForwardList.cpp
Source/WebCore/history/HistoryItem.cpp
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
Source/WebCore/loader/HistoryController.h
Source/WebCore/page/DiagnosticLoggingKeys.cpp
Source/WebCore/page/DiagnosticLoggingKeys.h
Source/WebCore/page/Frame.cpp
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/Settings.cpp
Source/WebCore/platform/MemoryPressureHandler.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/History/WebBackForwardList.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebView.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebProcess.cpp
Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm
Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp