-
ggaren authored
Reviewed by Darin Adler. Fixed <rdar://problem/5055182> The page cache has no global cap. Beefed up the PageCache class to track which HistoryItems are cached, and decide how to evict old HistoryItems as new ones are added. * history/BackForwardList.cpp: Removed support for managing the page cache through the BackForwardList since this is deprecated in Mac's WebBackForwardList, and doesn't exist on other platforms. Added a Page* back pointer so that Mac WebBackForwardList can still support its deprecated API, using the new hotness. This isn't a big burden, since Page is responsible for calling BackForwardList::close upon destruction, anyway. * history/HistoryItem.cpp: Replaced CachedPage* with boolean that tells you whether you're in the page cache. This prevents us from having more than one persistent repository for cached pages. * history/PageCache.cpp: If you're playing along at home, this code is the reason for the patch. * loader/FrameLoader.cpp: If you're playing along at home, the minuses in this file are the reason for the patch. Replaced call to FrameLoaderClient::loadedFromCachedPage with its one-line implementation because WebCore calling itself through WebKit is uncivilized. * page/Settings.cpp: Added support for removing a Page's HistoryItems from the page cache. WebKit: Reviewed by Darin Adler. Fixed <rdar://problem/5055182> The page cache has no global cap. The main WebKit changes are: 1. Changed -[WebBackForwardList setPageCacheSize] and -[WebBackForwardList pageCacheSize] to accomodate the new global page cache model, updating their documentation. 2. Added -[WebPreferences setShouldUsePageCache] and -[WebPreferences shouldUsePageCache] as pending public API. 3. Centralized calculation of object cache and page cache sizes inside WebPreferences. Cchanged our old behavior of reading a preference and applying a fudge factor with a new behavior of just using the preference directly. The old behavior was confusing and often inappropriate. (For example, if you set a page cache size of 100, a 256MB machine would somewhat arbitrarily reduce that number to 98. ???) * WebView/WebView.mm: Added support for two flags to determine whether to use the page cache. If either -[WebBackForwardList setPageCacheSize:0] or -[WebPreferences setShouldUsePageCache:NO] is called, we don't use the page cache. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@21793 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2e941233