<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[179247] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/179247">179247</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-01-28 01:33:54 -0800 (Wed, 28 Jan 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Rename pageCache() to PageCache::shared() and return a reference
https://bugs.webkit.org/show_bug.cgi?id=140983
Reviewed by Andreas Kling.
Rename pageCache() to PageCache::shared() as this is a singleton class
and have it return a reference instead of a pointer.
Source/WebCore:
* history/BackForwardList.cpp:
(WebCore::BackForwardList::addItem):
(WebCore::BackForwardList::setCapacity):
(WebCore::BackForwardList::clearAllPageCaches):
(WebCore::BackForwardList::close):
* history/CachedFrame.cpp:
(WebCore::CachedFrame::CachedFrame):
* history/HistoryItem.cpp:
(WebCore::HistoryItem::setURL):
* history/PageCache.cpp:
(WebCore::PageCache::shared):
(WebCore::PageCache::get):
(WebCore::pageCache): Deleted.
* history/PageCache.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::commitProvisionalLoad):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/HistoryController.cpp:
(WebCore::HistoryController::invalidateCurrentItemCachedPage):
(WebCore::HistoryController::updateForReload):
* page/Frame.cpp:
(WebCore::Frame::setPageAndTextZoomFactors):
* page/Page.cpp:
(WebCore::Page::setDeviceScaleFactor):
(WebCore::Page::setPagination):
(WebCore::Page::setVisitedLinkStore):
* page/PageGroup.cpp:
(WebCore::PageGroup::captionPreferencesChanged):
* page/Settings.cpp:
(WebCore::Settings::setUsesPageCache):
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::releaseCriticalMemory):
Source/WebKit/mac:
* History/WebBackForwardList.mm:
(-[WebBackForwardList pageCacheSize]):
* Misc/WebCoreStatistics.mm:
(+[WebCoreStatistics cachedPageCount]):
(+[WebCoreStatistics cachedFrameCount]):
* WebCoreSupport/WebVisitedLinkStore.mm:
(WebVisitedLinkStore::removeAllVisitedLinks):
(WebVisitedLinkStore::removeVisitedLink):
(WebVisitedLinkStore::addVisitedLinkHash):
* WebView/WebView.mm:
(+[WebView _setCacheModel:]):
Source/WebKit/win:
* WebCoreStatistics.cpp:
(WebCoreStatistics::cachedPageCount):
(WebCoreStatistics::cachedFrameCount):
* WebCoreSupport/WebVisitedLinkStore.cpp:
(WebVisitedLinkStore::removeAllVisitedLinks):
(WebVisitedLinkStore::addVisitedLinkHash):
* WebView.cpp:
(WebView::setCacheModel):
Source/WebKit2:
* WebProcess/WebPage/VisitedLinkTableController.cpp:
(WebKit::VisitedLinkTableController::setVisitedLinkTable):
(WebKit::VisitedLinkTableController::visitedLinkStateChanged):
(WebKit::VisitedLinkTableController::allVisitedLinkStateChanged):
(WebKit::VisitedLinkTableController::removeAllVisitedLinks):
* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::removeItem):
(WebKit::WebBackForwardListProxy::close):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::releasePageCache):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformSetCacheModel):
* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformSetCacheModel):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#trunkSourceWebCorehistoryBackForwardListcpp">trunk/Source/WebCore/history/BackForwardList.cpp</a></li>
<li><a href="#trunkSourceWebCorehistoryCachedFramecpp">trunk/Source/WebCore/history/CachedFrame.cpp</a></li>
<li><a href="#trunkSourceWebCorehistoryHistoryItemcpp">trunk/Source/WebCore/history/HistoryItem.cpp</a></li>
<li><a href="#trunkSourceWebCorehistoryPageCachecpp">trunk/Source/WebCore/history/PageCache.cpp</a></li>
<li><a href="#trunkSourceWebCorehistoryPageCacheh">trunk/Source/WebCore/history/PageCache.h</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoadercpp">trunk/Source/WebCore/loader/FrameLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderHistoryControllercpp">trunk/Source/WebCore/loader/HistoryController.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFramecpp">trunk/Source/WebCore/page/Frame.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageGroupcpp">trunk/Source/WebCore/page/PageGroup.cpp</a></li>
<li><a href="#trunkSourceWebCorepageSettingscpp">trunk/Source/WebCore/page/Settings.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformMemoryPressureHandlercpp">trunk/Source/WebCore/platform/MemoryPressureHandler.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacHistoryWebBackForwardListmm">trunk/Source/WebKit/mac/History/WebBackForwardList.mm</a></li>
<li><a href="#trunkSourceWebKitmacMiscWebCoreStatisticsmm">trunk/Source/WebKit/mac/Misc/WebCoreStatistics.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebVisitedLinkStoremm">trunk/Source/WebKit/mac/WebCoreSupport/WebVisitedLinkStore.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreStatisticscpp">trunk/Source/WebKit/win/WebCoreStatistics.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreSupportWebVisitedLinkStorecpp">trunk/Source/WebKit/win/WebCoreSupport/WebVisitedLinkStore.cpp</a></li>
<li><a href="#trunkSourceWebKitwinWebViewcpp">trunk/Source/WebKit/win/WebView.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageVisitedLinkTableControllercpp">trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebBackForwardListProxycpp">trunk/Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcesscocoaWebProcessCocoamm">trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcesssoupWebProcessSoupcpp">trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebCore/ChangeLog        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2015-01-28 Chris Dumez <cdumez@apple.com>
+
+ Rename pageCache() to PageCache::shared() and return a reference
+ https://bugs.webkit.org/show_bug.cgi?id=140983
+
+ Reviewed by Andreas Kling.
+
+ Rename pageCache() to PageCache::shared() as this is a singleton class
+ and have it return a reference instead of a pointer.
+
+ * history/BackForwardList.cpp:
+ (WebCore::BackForwardList::addItem):
+ (WebCore::BackForwardList::setCapacity):
+ (WebCore::BackForwardList::clearAllPageCaches):
+ (WebCore::BackForwardList::close):
+ * history/CachedFrame.cpp:
+ (WebCore::CachedFrame::CachedFrame):
+ * history/HistoryItem.cpp:
+ (WebCore::HistoryItem::setURL):
+ * history/PageCache.cpp:
+ (WebCore::PageCache::shared):
+ (WebCore::PageCache::get):
+ (WebCore::pageCache): Deleted.
+ * history/PageCache.h:
+ * loader/FrameLoader.cpp:
+ (WebCore::FrameLoader::commitProvisionalLoad):
+ (WebCore::FrameLoader::loadDifferentDocumentItem):
+ * loader/HistoryController.cpp:
+ (WebCore::HistoryController::invalidateCurrentItemCachedPage):
+ (WebCore::HistoryController::updateForReload):
+ * page/Frame.cpp:
+ (WebCore::Frame::setPageAndTextZoomFactors):
+ * page/Page.cpp:
+ (WebCore::Page::setDeviceScaleFactor):
+ (WebCore::Page::setPagination):
+ (WebCore::Page::setVisitedLinkStore):
+ * page/PageGroup.cpp:
+ (WebCore::PageGroup::captionPreferencesChanged):
+ * page/Settings.cpp:
+ (WebCore::Settings::setUsesPageCache):
+ * platform/MemoryPressureHandler.cpp:
+ (WebCore::MemoryPressureHandler::releaseCriticalMemory):
+
</ins><span class="cx"> 2015-01-28 Darin Adler <darin@apple.com>
</span><span class="cx">
</span><span class="cx"> Fix MediaPlayerEngine leaks
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebCore/WebCore.exp.in        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -1611,6 +1611,7 @@
</span><span class="cx"> __ZN7WebCore9PageCache18pruneToCapacityNowEiNS_13PruningReasonE
</span><span class="cx"> __ZN7WebCore9PageCache33markPagesForVistedLinkStyleRecalcEv
</span><span class="cx"> __ZN7WebCore9PageCache6removeEPNS_11HistoryItemE
</span><ins>+__ZN7WebCore9PageCache6sharedEv
</ins><span class="cx"> __ZN7WebCore9PageGroup9pageGroupERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore9Scrollbar11mouseExitedEv
</span><span class="cx"> __ZN7WebCore9Scrollbar12mouseEnteredEv
</span><span class="lines">@@ -1629,7 +1630,6 @@
</span><span class="cx"> __ZN7WebCore9endOfWordERKNS_15VisiblePositionENS_9EWordSideE
</span><span class="cx"> __ZN7WebCore9fontCacheEv
</span><span class="cx"> __ZN7WebCore9makeRangeERKNS_15VisiblePositionES2_
</span><del>-__ZN7WebCore9pageCacheEv
</del><span class="cx"> __ZN7WebCore9plainTextEPKNS_5RangeEtb
</span><span class="cx"> __ZN7WebCore9unionRectERKN3WTF6VectorINS_9FloatRectELm0ENS0_15CrashOnOverflowEEE
</span><span class="cx"> __ZNK3JSC8Bindings10RootObject12globalObjectEv
</span></span></pre></div>
<a id="trunkSourceWebCorehistoryBackForwardListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/BackForwardList.cpp (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/BackForwardList.cpp        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebCore/history/BackForwardList.cpp        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx"> RefPtr<HistoryItem> item = m_entries.last();
</span><span class="cx"> m_entries.removeLast();
</span><span class="cx"> m_entryHash.remove(item);
</span><del>- pageCache()->remove(item.get());
</del><ins>+ PageCache::shared().remove(item.get());
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx"> RefPtr<HistoryItem> item = m_entries[0];
</span><span class="cx"> m_entries.remove(0);
</span><span class="cx"> m_entryHash.remove(item);
</span><del>- pageCache()->remove(item.get());
</del><ins>+ PageCache::shared().remove(item.get());
</ins><span class="cx"> m_current--;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -175,7 +175,7 @@
</span><span class="cx"> RefPtr<HistoryItem> item = m_entries.last();
</span><span class="cx"> m_entries.removeLast();
</span><span class="cx"> m_entryHash.remove(item);
</span><del>- pageCache()->remove(item.get());
</del><ins>+ PageCache::shared().remove(item.get());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!size)
</span><span class="lines">@@ -247,7 +247,7 @@
</span><span class="cx"> HistoryItem* item = m_entries[i].get();
</span><span class="cx"> if (item->isInPageCache()) {
</span><span class="cx"> didRemoveAtLeastOneItem = true;
</span><del>- pageCache()->remove(item);
</del><ins>+ PageCache::shared().remove(item);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> return didRemoveAtLeastOneItem;
</span><span class="lines">@@ -258,7 +258,7 @@
</span><span class="cx"> {
</span><span class="cx"> int size = m_entries.size();
</span><span class="cx"> for (int i = 0; i < size; ++i)
</span><del>- pageCache()->remove(m_entries[i].get());
</del><ins>+ PageCache::shared().remove(m_entries[i].get());
</ins><span class="cx"> m_entries.clear();
</span><span class="cx"> m_entryHash.clear();
</span><span class="cx"> m_page = 0;
</span></span></pre></div>
<a id="trunkSourceWebCorehistoryCachedFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/CachedFrame.cpp (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/CachedFrame.cpp        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebCore/history/CachedFrame.cpp        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -173,7 +173,7 @@
</span><span class="cx">
</span><span class="cx"> frame.loader().client().savePlatformDataToCachedFrame(this);
</span><span class="cx">
</span><del>- if (m_isComposited && pageCache()->shouldClearBackingStores())
</del><ins>+ if (m_isComposited && PageCache::shared().shouldClearBackingStores())
</ins><span class="cx"> frame.view()->clearBackingStores();
</span><span class="cx">
</span><span class="cx"> // documentWillSuspendForPageCache() can set up a layout timer on the FrameView, so clear timers after that.
</span></span></pre></div>
<a id="trunkSourceWebCorehistoryHistoryItemcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/HistoryItem.cpp (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/HistoryItem.cpp        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebCore/history/HistoryItem.cpp        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -286,7 +286,7 @@
</span><span class="cx">
</span><span class="cx"> void HistoryItem::setURL(const URL& url)
</span><span class="cx"> {
</span><del>- pageCache()->remove(this);
</del><ins>+ PageCache::shared().remove(this);
</ins><span class="cx"> setURLString(url.string());
</span><span class="cx"> clearDocumentState();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehistoryPageCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/PageCache.cpp (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/PageCache.cpp        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebCore/history/PageCache.cpp        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -51,6 +51,7 @@
</span><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "SubframeLoader.h"
</span><span class="cx"> #include <wtf/CurrentTime.h>
</span><ins>+#include <wtf/NeverDestroyed.h>
</ins><span class="cx"> #include <wtf/TemporaryChange.h>
</span><span class="cx"> #include <wtf/text/CString.h>
</span><span class="cx"> #include <wtf/text/StringConcatenate.h>
</span><span class="lines">@@ -291,10 +292,10 @@
</span><span class="cx"> diagnosticLoggingClient.logDiagnosticMessageWithResult(DiagnosticLoggingKeys::pageCacheKey(), emptyString(), rejectReasons ? DiagnosticLoggingResultFail : DiagnosticLoggingResultPass);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PageCache* pageCache()
</del><ins>+PageCache& PageCache::shared()
</ins><span class="cx"> {
</span><del>- static PageCache* staticPageCache = new PageCache;
- return staticPageCache;
</del><ins>+ static NeverDestroyed<PageCache> globalPageCache;
+ return globalPageCache;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> PageCache::PageCache()
</span><span class="lines">@@ -507,7 +508,7 @@
</span><span class="cx">
</span><span class="cx"> LOG(PageCache, "Not restoring page for %s from back/forward cache because cache entry has expired", item->url().string().ascii().data());
</span><span class="cx"> logPageCacheFailureDiagnosticMessage(page, DiagnosticLoggingKeys::expiredKey());
</span><del>- pageCache()->remove(item);
</del><ins>+ PageCache::shared().remove(item);
</ins><span class="cx"> } else if (item->m_pruningReason != PruningReason::None)
</span><span class="cx"> logPageCacheFailureDiagnosticMessage(page, pruningReasonToDiagnosticLoggingKey(item->m_pruningReason));
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehistoryPageCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/history/PageCache.h (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/history/PageCache.h        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebCore/history/PageCache.h        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -43,7 +43,10 @@
</span><span class="cx"> class PageCache {
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(PageCache); WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>- friend PageCache* pageCache();
</del><ins>+ friend class NeverDestroyed<PageCache>;
+
+ // Function to obtain the global page cache.
+ WEBCORE_EXPORT static PageCache& shared();
</ins><span class="cx">
</span><span class="cx"> bool canCache(Page*) const;
</span><span class="cx">
</span><span class="lines">@@ -75,7 +78,7 @@
</span><span class="cx"> void markPagesForDeviceScaleChanged(Page*);
</span><span class="cx">
</span><span class="cx"> private:
</span><del>- PageCache(); // Use pageCache() instead.
</del><ins>+ PageCache(); // Use shared() instead.
</ins><span class="cx"> ~PageCache(); // Not implemented to make sure nobody accidentally calls delete -- WebCore does not delete singletons.
</span><span class="cx">
</span><span class="cx"> static bool canCachePageContainingThisFrame(Frame*);
</span><span class="lines">@@ -95,9 +98,6 @@
</span><span class="cx"> bool m_shouldClearBackingStores;
</span><span class="cx"> };
</span><span class="cx">
</span><del>- // Function to obtain the global page cache.
- WEBCORE_EXPORT PageCache* pageCache();
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // PageCache_h
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.cpp        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -1741,7 +1741,7 @@
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<CachedPage> cachedPage;
</span><span class="cx"> if (m_loadingFromCachedPage)
</span><del>- cachedPage = pageCache()->take(history().provisionalItem(), m_frame.page());
</del><ins>+ cachedPage = PageCache::shared().take(history().provisionalItem(), m_frame.page());
</ins><span class="cx">
</span><span class="cx"> LOG(PageCache, "WebCoreLoading %s: About to commit provisional load from previous URL '%s' to new URL '%s'", m_frame.tree().uniqueName().string().utf8().data(),
</span><span class="cx"> m_frame.document() ? m_frame.document()->url().stringCenterEllipsizedToLength().utf8().data() : "",
</span><span class="lines">@@ -1758,11 +1758,11 @@
</span><span class="cx"> LOG(MemoryPressure, "Pruning page cache because under memory pressure at: %s", __PRETTY_FUNCTION__);
</span><span class="cx"> LOG(PageCache, "Pruning page cache to 0 due to memory pressure");
</span><span class="cx"> // Don't cache any page if we are under memory pressure.
</span><del>- pageCache()->pruneToCapacityNow(0, PruningReason::MemoryPressure);
</del><ins>+ PageCache::shared().pruneToCapacityNow(0, PruningReason::MemoryPressure);
</ins><span class="cx"> } else if (systemMemoryLevel() <= memoryLevelThresholdToPrunePageCache) {
</span><span class="cx"> LOG(MemoryPressure, "Pruning page cache because system memory level is %d at: %s", systemMemoryLevel(), __PRETTY_FUNCTION__);
</span><del>- LOG(PageCache, "Pruning page cache to %d due to low memory (level %d less or equal to %d threshold)", pageCache()->capacity() / 2, systemMemoryLevel(), memoryLevelThresholdToPrunePageCache);
- pageCache()->pruneToCapacityNow(pageCache()->capacity() / 2, PruningReason::MemoryPressure);
</del><ins>+ LOG(PageCache, "Pruning page cache to %d due to low memory (level %d less or equal to %d threshold)", PageCache::shared().capacity() / 2, systemMemoryLevel(), memoryLevelThresholdToPrunePageCache);
+ PageCache::shared().pruneToCapacityNow(PageCache::shared().capacity() / 2, PruningReason::MemoryPressure);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="lines">@@ -1772,8 +1772,8 @@
</span><span class="cx"> // Check to see if we need to cache the page we are navigating away from into the back/forward cache.
</span><span class="cx"> // We are doing this here because we know for sure that a new page is about to be loaded.
</span><span class="cx"> HistoryItem* item = history().currentItem();
</span><del>- if (!m_frame.tree().parent() && pageCache()->canCache(m_frame.page()) && !item->isInPageCache())
- pageCache()->add(item, *m_frame.page());
</del><ins>+ if (!m_frame.tree().parent() && PageCache::shared().canCache(m_frame.page()) && !item->isInPageCache())
+ PageCache::shared().add(item, *m_frame.page());
</ins><span class="cx">
</span><span class="cx"> if (m_loadType != FrameLoadType::Replace)
</span><span class="cx"> closeOldDataSources();
</span><span class="lines">@@ -3159,7 +3159,7 @@
</span><span class="cx"> // Remember this item so we can traverse any child items as child frames load
</span><span class="cx"> history().setProvisionalItem(item);
</span><span class="cx">
</span><del>- if (CachedPage* cachedPage = pageCache()->get(item, m_frame.page())) {
</del><ins>+ if (CachedPage* cachedPage = PageCache::shared().get(item, m_frame.page())) {
</ins><span class="cx"> auto documentLoader = cachedPage->documentLoader();
</span><span class="cx"> documentLoader->setTriggeringAction(NavigationAction(documentLoader->request(), loadType, false));
</span><span class="cx"> documentLoader->setLastCheckedRequest(ResourceRequest());
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderHistoryControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/HistoryController.cpp (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/HistoryController.cpp        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebCore/loader/HistoryController.cpp        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -235,10 +235,10 @@
</span><span class="cx"> void HistoryController::invalidateCurrentItemCachedPage()
</span><span class="cx"> {
</span><span class="cx"> // When we are pre-commit, the currentItem is where any page cache data resides.
</span><del>- if (!pageCache()->get(currentItem(), m_frame.page()))
</del><ins>+ if (!PageCache::shared().get(currentItem(), m_frame.page()))
</ins><span class="cx"> return;
</span><span class="cx">
</span><del>- std::unique_ptr<CachedPage> cachedPage = pageCache()->take(currentItem(), m_frame.page());
</del><ins>+ std::unique_ptr<CachedPage> cachedPage = PageCache::shared().take(currentItem(), m_frame.page());
</ins><span class="cx">
</span><span class="cx"> // FIXME: This is a grotesque hack to fix <rdar://problem/4059059> Crash in RenderFlow::detach
</span><span class="cx"> // Somehow the PageState object is not properly updated, and is holding onto a stale document.
</span><span class="lines">@@ -334,7 +334,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> if (m_currentItem) {
</span><del>- pageCache()->remove(m_currentItem.get());
</del><ins>+ PageCache::shared().remove(m_currentItem.get());
</ins><span class="cx">
</span><span class="cx"> if (m_frame.loader().loadType() == FrameLoadType::Reload || m_frame.loader().loadType() == FrameLoadType::ReloadFromOrigin)
</span><span class="cx"> saveScrollPositionAndViewStateToItem(m_currentItem.get());
</span></span></pre></div>
<a id="trunkSourceWebCorepageFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Frame.cpp (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Frame.cpp        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebCore/page/Frame.cpp        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -989,7 +989,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (isMainFrame())
</span><del>- pageCache()->markPagesForFullStyleRecalc(page);
</del><ins>+ PageCache::shared().markPagesForFullStyleRecalc(page);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> float Frame::frameScaleFactor() const
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebCore/page/Page.cpp        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -839,9 +839,9 @@
</span><span class="cx"> setNeedsRecalcStyleInAllFrames();
</span><span class="cx">
</span><span class="cx"> mainFrame().deviceOrPageScaleFactorChanged();
</span><del>- pageCache()->markPagesForDeviceScaleChanged(this);
</del><ins>+ PageCache::shared().markPagesForDeviceScaleChanged(this);
</ins><span class="cx">
</span><del>- pageCache()->markPagesForFullStyleRecalc(this);
</del><ins>+ PageCache::shared().markPagesForFullStyleRecalc(this);
</ins><span class="cx"> GraphicsContext::updateDocumentMarkerResources();
</span><span class="cx">
</span><span class="cx"> mainFrame().pageOverlayController().didChangeDeviceScaleFactor();
</span><span class="lines">@@ -921,7 +921,7 @@
</span><span class="cx"> m_pagination = pagination;
</span><span class="cx">
</span><span class="cx"> setNeedsRecalcStyleInAllFrames();
</span><del>- pageCache()->markPagesForFullStyleRecalc(this);
</del><ins>+ PageCache::shared().markPagesForFullStyleRecalc(this);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> unsigned Page::pageCount() const
</span><span class="lines">@@ -1661,7 +1661,7 @@
</span><span class="cx"> m_visitedLinkStore->addPage(*this);
</span><span class="cx">
</span><span class="cx"> invalidateStylesForAllLinks();
</span><del>- pageCache()->markPagesForFullStyleRecalc(this);
</del><ins>+ PageCache::shared().markPagesForFullStyleRecalc(this);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SessionID Page::sessionID() const
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageGroupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageGroup.cpp (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageGroup.cpp        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebCore/page/PageGroup.cpp        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx"> {
</span><span class="cx"> for (auto it = m_pages.begin(), end = m_pages.end(); it != end; ++it)
</span><span class="cx"> (*it)->captionPreferencesChanged();
</span><del>- pageCache()->markPagesForCaptionPreferencesChanged();
</del><ins>+ PageCache::shared().markPagesForCaptionPreferencesChanged();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> CaptionUserPreferences* PageGroup::captionPreferences()
</span></span></pre></div>
<a id="trunkSourceWebCorepageSettingscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Settings.cpp (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Settings.cpp        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebCore/page/Settings.cpp        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -523,7 +523,7 @@
</span><span class="cx"> int first = -m_page->backForward().backCount();
</span><span class="cx"> int last = m_page->backForward().forwardCount();
</span><span class="cx"> for (int i = first; i <= last; i++)
</span><del>- pageCache()->remove(m_page->backForward().itemAtIndex(i));
</del><ins>+ PageCache::shared().remove(m_page->backForward().itemAtIndex(i));
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformMemoryPressureHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/MemoryPressureHandler.cpp (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/MemoryPressureHandler.cpp        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebCore/platform/MemoryPressureHandler.cpp        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx"> ReliefLogger log("Empty the PageCache");
</span><span class="cx"> // Right now, the only reason we call release critical memory while not under memory pressure is if the process is about to be suspended.
</span><span class="cx"> PruningReason pruningReason = memoryPressureHandler().isUnderMemoryPressure() ? PruningReason::MemoryPressure : PruningReason::ProcessSuspended;
</span><del>- pageCache()->pruneToCapacityNow(0, pruningReason);
</del><ins>+ PageCache::shared().pruneToCapacityNow(0, pruningReason);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebKit/mac/ChangeLog        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2015-01-28 Chris Dumez <cdumez@apple.com>
+
+ Rename pageCache() to PageCache::shared() and return a reference
+ https://bugs.webkit.org/show_bug.cgi?id=140983
+
+ Reviewed by Andreas Kling.
+
+ Rename pageCache() to PageCache::shared() as this is a singleton class
+ and have it return a reference instead of a pointer.
+
+ * History/WebBackForwardList.mm:
+ (-[WebBackForwardList pageCacheSize]):
+ * Misc/WebCoreStatistics.mm:
+ (+[WebCoreStatistics cachedPageCount]):
+ (+[WebCoreStatistics cachedFrameCount]):
+ * WebCoreSupport/WebVisitedLinkStore.mm:
+ (WebVisitedLinkStore::removeAllVisitedLinks):
+ (WebVisitedLinkStore::removeVisitedLink):
+ (WebVisitedLinkStore::addVisitedLinkHash):
+ * WebView/WebView.mm:
+ (+[WebView _setCacheModel:]):
+
</ins><span class="cx"> 2015-01-27 Alexey Proskuryakov <ap@apple.com>
</span><span class="cx">
</span><span class="cx"> More build fixes for newer clang.
</span></span></pre></div>
<a id="trunkSourceWebKitmacHistoryWebBackForwardListmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/History/WebBackForwardList.mm (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/History/WebBackForwardList.mm        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebKit/mac/History/WebBackForwardList.mm        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -355,7 +355,7 @@
</span><span class="cx">
</span><span class="cx"> - (NSUInteger)pageCacheSize
</span><span class="cx"> {
</span><del>- return [kit(core(self)->page()) usesPageCache] ? pageCache()->capacity() : 0;
</del><ins>+ return [kit(core(self)->page()) usesPageCache] ? PageCache::shared().capacity() : 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (int)backListCount
</span></span></pre></div>
<a id="trunkSourceWebKitmacMiscWebCoreStatisticsmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Misc/WebCoreStatistics.mm (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Misc/WebCoreStatistics.mm        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebKit/mac/Misc/WebCoreStatistics.mm        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -224,12 +224,12 @@
</span><span class="cx">
</span><span class="cx"> + (int)cachedPageCount
</span><span class="cx"> {
</span><del>- return pageCache()->pageCount();
</del><ins>+ return PageCache::shared().pageCount();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> + (int)cachedFrameCount
</span><span class="cx"> {
</span><del>- return pageCache()->frameCount();
</del><ins>+ return PageCache::shared().frameCount();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Deprecated
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebVisitedLinkStoremm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebVisitedLinkStore.mm (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebVisitedLinkStore.mm        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebVisitedLinkStore.mm        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -74,7 +74,7 @@
</span><span class="cx"> {
</span><span class="cx"> for (auto& visitedLinkStore : visitedLinkStores())
</span><span class="cx"> visitedLinkStore->removeVisitedLinkHashes();
</span><del>- pageCache()->markPagesForVistedLinkStyleRecalc();
</del><ins>+ PageCache::shared().markPagesForVistedLinkStyleRecalc();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebVisitedLinkStore::addVisitedLink(NSString *urlString)
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx"> m_visitedLinkHashes.remove(linkHash);
</span><span class="cx">
</span><span class="cx"> invalidateStylesForLink(linkHash);
</span><del>- pageCache()->markPagesForVistedLinkStyleRecalc();
</del><ins>+ PageCache::shared().markPagesForVistedLinkStyleRecalc();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool WebVisitedLinkStore::isLinkVisited(Page& page, LinkHash linkHash, const URL& baseURL, const AtomicString& attributeURL)
</span><span class="lines">@@ -152,7 +152,7 @@
</span><span class="cx"> m_visitedLinkHashes.add(linkHash);
</span><span class="cx">
</span><span class="cx"> invalidateStylesForLink(linkHash);
</span><del>- pageCache()->markPagesForVistedLinkStyleRecalc();
</del><ins>+ PageCache::shared().markPagesForVistedLinkStyleRecalc();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebVisitedLinkStore::removeVisitedLinkHashes()
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -7935,9 +7935,9 @@
</span><span class="cx">
</span><span class="cx"> memoryCache().setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
</span><span class="cx"> memoryCache().setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
</span><del>- pageCache()->setCapacity(pageCacheCapacity);
</del><ins>+ PageCache::shared().setCapacity(pageCacheCapacity);
</ins><span class="cx"> #if PLATFORM(IOS)
</span><del>- pageCache()->setShouldClearBackingStores(true);
</del><ins>+ PageCache::shared().setShouldClearBackingStores(true);
</ins><span class="cx"> nsurlCacheMemoryCapacity = std::max(nsurlCacheMemoryCapacity, [nsurlCache memoryCapacity]);
</span><span class="cx"> CFURLCacheRef cfCache;
</span><span class="cx"> if ([nsurlCache respondsToSelector:@selector(_CFURLCache)] && (cfCache = [nsurlCache _CFURLCache]))
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebKit/win/ChangeLog        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2015-01-28 Chris Dumez <cdumez@apple.com>
+
+ Rename pageCache() to PageCache::shared() and return a reference
+ https://bugs.webkit.org/show_bug.cgi?id=140983
+
+ Reviewed by Andreas Kling.
+
+ Rename pageCache() to PageCache::shared() as this is a singleton class
+ and have it return a reference instead of a pointer.
+
+ * WebCoreStatistics.cpp:
+ (WebCoreStatistics::cachedPageCount):
+ (WebCoreStatistics::cachedFrameCount):
+ * WebCoreSupport/WebVisitedLinkStore.cpp:
+ (WebVisitedLinkStore::removeAllVisitedLinks):
+ (WebVisitedLinkStore::addVisitedLinkHash):
+ * WebView.cpp:
+ (WebView::setCacheModel):
+
</ins><span class="cx"> 2015-01-27 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Use a Ref<CachedResourceLoader> in Document instead of a RefPtr
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreStatisticscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCoreStatistics.cpp (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreStatistics.cpp        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebKit/win/WebCoreStatistics.cpp        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -327,7 +327,7 @@
</span><span class="cx"> if (!count)
</span><span class="cx"> return E_POINTER;
</span><span class="cx">
</span><del>- *count = pageCache()->pageCount();
</del><ins>+ *count = PageCache::shared().pageCount();
</ins><span class="cx"> return S_OK;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -336,6 +336,6 @@
</span><span class="cx"> if (!count)
</span><span class="cx"> return E_POINTER;
</span><span class="cx">
</span><del>- *count = pageCache()->frameCount();
</del><ins>+ *count = PageCache::shared().frameCount();
</ins><span class="cx"> return S_OK;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreSupportWebVisitedLinkStorecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCoreSupport/WebVisitedLinkStore.cpp (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreSupport/WebVisitedLinkStore.cpp        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebVisitedLinkStore.cpp        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx"> void WebVisitedLinkStore::removeAllVisitedLinks()
</span><span class="cx"> {
</span><span class="cx"> shared().removeVisitedLinkHashes();
</span><del>- pageCache()->markPagesForVistedLinkStyleRecalc();
</del><ins>+ PageCache::shared().markPagesForVistedLinkStyleRecalc();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebVisitedLinkStore::addVisitedLink(const String& urlString)
</span><span class="lines">@@ -116,7 +116,7 @@
</span><span class="cx"> m_visitedLinkHashes.add(linkHash);
</span><span class="cx">
</span><span class="cx"> invalidateStylesForLink(linkHash);
</span><del>- pageCache()->markPagesForVistedLinkStyleRecalc();
</del><ins>+ PageCache::shared().markPagesForVistedLinkStyleRecalc();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void WebVisitedLinkStore::removeVisitedLinkHashes()
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebView.cpp (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebView.cpp        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebKit/win/WebView.cpp        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -675,7 +675,7 @@
</span><span class="cx">
</span><span class="cx"> memoryCache().setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
</span><span class="cx"> memoryCache().setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
</span><del>- pageCache()->setCapacity(pageCacheCapacity);
</del><ins>+ PageCache::shared().setCapacity(pageCacheCapacity);
</ins><span class="cx">
</span><span class="cx"> #if USE(CFNETWORK)
</span><span class="cx"> // Don't shrink a big disk cache, since that would cause churn.
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebKit2/ChangeLog        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2015-01-28 Chris Dumez <cdumez@apple.com>
+
+ Rename pageCache() to PageCache::shared() and return a reference
+ https://bugs.webkit.org/show_bug.cgi?id=140983
+
+ Reviewed by Andreas Kling.
+
+ Rename pageCache() to PageCache::shared() as this is a singleton class
+ and have it return a reference instead of a pointer.
+
+ * WebProcess/WebPage/VisitedLinkTableController.cpp:
+ (WebKit::VisitedLinkTableController::setVisitedLinkTable):
+ (WebKit::VisitedLinkTableController::visitedLinkStateChanged):
+ (WebKit::VisitedLinkTableController::allVisitedLinkStateChanged):
+ (WebKit::VisitedLinkTableController::removeAllVisitedLinks):
+ * WebProcess/WebPage/WebBackForwardListProxy.cpp:
+ (WebKit::WebBackForwardListProxy::removeItem):
+ (WebKit::WebBackForwardListProxy::close):
+ * WebProcess/WebProcess.cpp:
+ (WebKit::WebProcess::releasePageCache):
+ * WebProcess/cocoa/WebProcessCocoa.mm:
+ (WebKit::WebProcess::platformSetCacheModel):
+ * WebProcess/soup/WebProcessSoup.cpp:
+ (WebKit::WebProcess::platformSetCacheModel):
+
</ins><span class="cx"> 2015-01-27 Alexey Proskuryakov <ap@apple.com>
</span><span class="cx">
</span><span class="cx"> More build fixes for newer clang.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageVisitedLinkTableControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -97,20 +97,20 @@
</span><span class="cx"> m_visitedLinkTable.setSharedMemory(sharedMemory.release());
</span><span class="cx">
</span><span class="cx"> invalidateStylesForAllLinks();
</span><del>- pageCache()->markPagesForVistedLinkStyleRecalc();
</del><ins>+ PageCache::shared().markPagesForVistedLinkStyleRecalc();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void VisitedLinkTableController::visitedLinkStateChanged(const Vector<WebCore::LinkHash>& linkHashes)
</span><span class="cx"> {
</span><span class="cx"> for (auto linkHash : linkHashes)
</span><span class="cx"> invalidateStylesForLink(linkHash);
</span><del>- pageCache()->markPagesForVistedLinkStyleRecalc();
</del><ins>+ PageCache::shared().markPagesForVistedLinkStyleRecalc();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void VisitedLinkTableController::allVisitedLinkStateChanged()
</span><span class="cx"> {
</span><span class="cx"> invalidateStylesForAllLinks();
</span><del>- pageCache()->markPagesForVistedLinkStyleRecalc();
</del><ins>+ PageCache::shared().markPagesForVistedLinkStyleRecalc();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void VisitedLinkTableController::removeAllVisitedLinks()
</span><span class="lines">@@ -118,7 +118,7 @@
</span><span class="cx"> m_visitedLinkTable.clear();
</span><span class="cx">
</span><span class="cx"> invalidateStylesForAllLinks();
</span><del>- pageCache()->markPagesForVistedLinkStyleRecalc();
</del><ins>+ PageCache::shared().markPagesForVistedLinkStyleRecalc();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebBackForwardListProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -132,7 +132,7 @@
</span><span class="cx"> if (!item)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- pageCache()->remove(item.get());
</del><ins>+ PageCache::shared().remove(item.get());
</ins><span class="cx"> WebCore::Page::clearPreviousItemFromAllPages(item.get());
</span><span class="cx"> historyItemToIDMap().remove(item);
</span><span class="cx"> }
</span><span class="lines">@@ -218,7 +218,7 @@
</span><span class="cx"> {
</span><span class="cx"> HashSet<uint64_t>::iterator end = m_associatedItemIDs.end();
</span><span class="cx"> for (HashSet<uint64_t>::iterator i = m_associatedItemIDs.begin(); i != end; ++i)
</span><del>- WebCore::pageCache()->remove(itemForID(*i));
</del><ins>+ WebCore::PageCache::shared().remove(itemForID(*i));
</ins><span class="cx">
</span><span class="cx"> m_associatedItemIDs.clear();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -1116,7 +1116,7 @@
</span><span class="cx">
</span><span class="cx"> void WebProcess::releasePageCache()
</span><span class="cx"> {
</span><del>- pageCache()->pruneToCapacityNow(0, PruningReason::MemoryPressure);
</del><ins>+ PageCache::shared().pruneToCapacityNow(0, PruningReason::MemoryPressure);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if !PLATFORM(COCOA)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcesscocoaWebProcessCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -115,7 +115,7 @@
</span><span class="cx">
</span><span class="cx"> memoryCache().setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
</span><span class="cx"> memoryCache().setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
</span><del>- pageCache()->setCapacity(pageCacheCapacity);
</del><ins>+ PageCache::shared().setCapacity(pageCacheCapacity);
</ins><span class="cx">
</span><span class="cx"> NSURLCache *nsurlCache = [NSURLCache sharedURLCache];
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcesssoupWebProcessSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp (179246 => 179247)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp        2015-01-28 09:22:02 UTC (rev 179246)
+++ trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp        2015-01-28 09:33:54 UTC (rev 179247)
</span><span class="lines">@@ -104,10 +104,10 @@
</span><span class="cx"> WebCore::memoryCache().setDisabled(cacheModel == CacheModelDocumentViewer);
</span><span class="cx"> WebCore::memoryCache().setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
</span><span class="cx"> WebCore::memoryCache().setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
</span><del>- WebCore::pageCache()->setCapacity(pageCacheCapacity);
</del><ins>+ WebCore::PageCache::shared().setCapacity(pageCacheCapacity);
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(GTK)
</span><del>- WebCore::pageCache()->setShouldClearBackingStores(true);
</del><ins>+ WebCore::PageCache::shared().setShouldClearBackingStores(true);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> if (!usesNetworkProcess()) {
</span></span></pre>
</div>
</div>
</body>
</html>