Diff
Modified: trunk/Source/WebCore/ChangeLog (179246 => 179247)
--- 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)
@@ -1,3 +1,46 @@
+2015-01-28 Chris Dumez <[email protected]>
+
+ 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):
+
2015-01-28 Darin Adler <[email protected]>
Fix MediaPlayerEngine leaks
Modified: trunk/Source/WebCore/WebCore.exp.in (179246 => 179247)
--- 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)
@@ -1611,6 +1611,7 @@
__ZN7WebCore9PageCache18pruneToCapacityNowEiNS_13PruningReasonE
__ZN7WebCore9PageCache33markPagesForVistedLinkStyleRecalcEv
__ZN7WebCore9PageCache6removeEPNS_11HistoryItemE
+__ZN7WebCore9PageCache6sharedEv
__ZN7WebCore9PageGroup9pageGroupERKN3WTF6StringE
__ZN7WebCore9Scrollbar11mouseExitedEv
__ZN7WebCore9Scrollbar12mouseEnteredEv
@@ -1629,7 +1630,6 @@
__ZN7WebCore9endOfWordERKNS_15VisiblePositionENS_9EWordSideE
__ZN7WebCore9fontCacheEv
__ZN7WebCore9makeRangeERKNS_15VisiblePositionES2_
-__ZN7WebCore9pageCacheEv
__ZN7WebCore9plainTextEPKNS_5RangeEtb
__ZN7WebCore9unionRectERKN3WTF6VectorINS_9FloatRectELm0ENS0_15CrashOnOverflowEEE
__ZNK3JSC8Bindings10RootObject12globalObjectEv
Modified: trunk/Source/WebCore/history/BackForwardList.cpp (179246 => 179247)
--- 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)
@@ -68,7 +68,7 @@
RefPtr<HistoryItem> item = m_entries.last();
m_entries.removeLast();
m_entryHash.remove(item);
- pageCache()->remove(item.get());
+ PageCache::shared().remove(item.get());
}
}
@@ -78,7 +78,7 @@
RefPtr<HistoryItem> item = m_entries[0];
m_entries.remove(0);
m_entryHash.remove(item);
- pageCache()->remove(item.get());
+ PageCache::shared().remove(item.get());
m_current--;
}
@@ -175,7 +175,7 @@
RefPtr<HistoryItem> item = m_entries.last();
m_entries.removeLast();
m_entryHash.remove(item);
- pageCache()->remove(item.get());
+ PageCache::shared().remove(item.get());
}
if (!size)
@@ -247,7 +247,7 @@
HistoryItem* item = m_entries[i].get();
if (item->isInPageCache()) {
didRemoveAtLeastOneItem = true;
- pageCache()->remove(item);
+ PageCache::shared().remove(item);
}
}
return didRemoveAtLeastOneItem;
@@ -258,7 +258,7 @@
{
int size = m_entries.size();
for (int i = 0; i < size; ++i)
- pageCache()->remove(m_entries[i].get());
+ PageCache::shared().remove(m_entries[i].get());
m_entries.clear();
m_entryHash.clear();
m_page = 0;
Modified: trunk/Source/WebCore/history/CachedFrame.cpp (179246 => 179247)
--- 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)
@@ -173,7 +173,7 @@
frame.loader().client().savePlatformDataToCachedFrame(this);
- if (m_isComposited && pageCache()->shouldClearBackingStores())
+ if (m_isComposited && PageCache::shared().shouldClearBackingStores())
frame.view()->clearBackingStores();
// documentWillSuspendForPageCache() can set up a layout timer on the FrameView, so clear timers after that.
Modified: trunk/Source/WebCore/history/HistoryItem.cpp (179246 => 179247)
--- 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)
@@ -286,7 +286,7 @@
void HistoryItem::setURL(const URL& url)
{
- pageCache()->remove(this);
+ PageCache::shared().remove(this);
setURLString(url.string());
clearDocumentState();
}
Modified: trunk/Source/WebCore/history/PageCache.cpp (179246 => 179247)
--- 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)
@@ -51,6 +51,7 @@
#include "Settings.h"
#include "SubframeLoader.h"
#include <wtf/CurrentTime.h>
+#include <wtf/NeverDestroyed.h>
#include <wtf/TemporaryChange.h>
#include <wtf/text/CString.h>
#include <wtf/text/StringConcatenate.h>
@@ -291,10 +292,10 @@
diagnosticLoggingClient.logDiagnosticMessageWithResult(DiagnosticLoggingKeys::pageCacheKey(), emptyString(), rejectReasons ? DiagnosticLoggingResultFail : DiagnosticLoggingResultPass);
}
-PageCache* pageCache()
+PageCache& PageCache::shared()
{
- static PageCache* staticPageCache = new PageCache;
- return staticPageCache;
+ static NeverDestroyed<PageCache> globalPageCache;
+ return globalPageCache;
}
PageCache::PageCache()
@@ -507,7 +508,7 @@
LOG(PageCache, "Not restoring page for %s from back/forward cache because cache entry has expired", item->url().string().ascii().data());
logPageCacheFailureDiagnosticMessage(page, DiagnosticLoggingKeys::expiredKey());
- pageCache()->remove(item);
+ PageCache::shared().remove(item);
} else if (item->m_pruningReason != PruningReason::None)
logPageCacheFailureDiagnosticMessage(page, pruningReasonToDiagnosticLoggingKey(item->m_pruningReason));
Modified: trunk/Source/WebCore/history/PageCache.h (179246 => 179247)
--- 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)
@@ -43,7 +43,10 @@
class PageCache {
WTF_MAKE_NONCOPYABLE(PageCache); WTF_MAKE_FAST_ALLOCATED;
public:
- friend PageCache* pageCache();
+ friend class NeverDestroyed<PageCache>;
+
+ // Function to obtain the global page cache.
+ WEBCORE_EXPORT static PageCache& shared();
bool canCache(Page*) const;
@@ -75,7 +78,7 @@
void markPagesForDeviceScaleChanged(Page*);
private:
- PageCache(); // Use pageCache() instead.
+ PageCache(); // Use shared() instead.
~PageCache(); // Not implemented to make sure nobody accidentally calls delete -- WebCore does not delete singletons.
static bool canCachePageContainingThisFrame(Frame*);
@@ -95,9 +98,6 @@
bool m_shouldClearBackingStores;
};
- // Function to obtain the global page cache.
- WEBCORE_EXPORT PageCache* pageCache();
-
} // namespace WebCore
#endif // PageCache_h
Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (179246 => 179247)
--- 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)
@@ -1741,7 +1741,7 @@
std::unique_ptr<CachedPage> cachedPage;
if (m_loadingFromCachedPage)
- cachedPage = pageCache()->take(history().provisionalItem(), m_frame.page());
+ cachedPage = PageCache::shared().take(history().provisionalItem(), m_frame.page());
LOG(PageCache, "WebCoreLoading %s: About to commit provisional load from previous URL '%s' to new URL '%s'", m_frame.tree().uniqueName().string().utf8().data(),
m_frame.document() ? m_frame.document()->url().stringCenterEllipsizedToLength().utf8().data() : "",
@@ -1758,11 +1758,11 @@
LOG(MemoryPressure, "Pruning page cache because under memory pressure at: %s", __PRETTY_FUNCTION__);
LOG(PageCache, "Pruning page cache to 0 due to memory pressure");
// Don't cache any page if we are under memory pressure.
- pageCache()->pruneToCapacityNow(0, PruningReason::MemoryPressure);
+ PageCache::shared().pruneToCapacityNow(0, PruningReason::MemoryPressure);
} else if (systemMemoryLevel() <= memoryLevelThresholdToPrunePageCache) {
LOG(MemoryPressure, "Pruning page cache because system memory level is %d at: %s", systemMemoryLevel(), __PRETTY_FUNCTION__);
- 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);
+ 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);
}
}
#endif
@@ -1772,8 +1772,8 @@
// Check to see if we need to cache the page we are navigating away from into the back/forward cache.
// We are doing this here because we know for sure that a new page is about to be loaded.
HistoryItem* item = history().currentItem();
- if (!m_frame.tree().parent() && pageCache()->canCache(m_frame.page()) && !item->isInPageCache())
- pageCache()->add(item, *m_frame.page());
+ if (!m_frame.tree().parent() && PageCache::shared().canCache(m_frame.page()) && !item->isInPageCache())
+ PageCache::shared().add(item, *m_frame.page());
if (m_loadType != FrameLoadType::Replace)
closeOldDataSources();
@@ -3159,7 +3159,7 @@
// Remember this item so we can traverse any child items as child frames load
history().setProvisionalItem(item);
- if (CachedPage* cachedPage = pageCache()->get(item, m_frame.page())) {
+ if (CachedPage* cachedPage = PageCache::shared().get(item, m_frame.page())) {
auto documentLoader = cachedPage->documentLoader();
documentLoader->setTriggeringAction(NavigationAction(documentLoader->request(), loadType, false));
documentLoader->setLastCheckedRequest(ResourceRequest());
Modified: trunk/Source/WebCore/loader/HistoryController.cpp (179246 => 179247)
--- 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)
@@ -235,10 +235,10 @@
void HistoryController::invalidateCurrentItemCachedPage()
{
// When we are pre-commit, the currentItem is where any page cache data resides.
- if (!pageCache()->get(currentItem(), m_frame.page()))
+ if (!PageCache::shared().get(currentItem(), m_frame.page()))
return;
- std::unique_ptr<CachedPage> cachedPage = pageCache()->take(currentItem(), m_frame.page());
+ std::unique_ptr<CachedPage> cachedPage = PageCache::shared().take(currentItem(), m_frame.page());
// FIXME: This is a grotesque hack to fix <rdar://problem/4059059> Crash in RenderFlow::detach
// Somehow the PageState object is not properly updated, and is holding onto a stale document.
@@ -334,7 +334,7 @@
#endif
if (m_currentItem) {
- pageCache()->remove(m_currentItem.get());
+ PageCache::shared().remove(m_currentItem.get());
if (m_frame.loader().loadType() == FrameLoadType::Reload || m_frame.loader().loadType() == FrameLoadType::ReloadFromOrigin)
saveScrollPositionAndViewStateToItem(m_currentItem.get());
Modified: trunk/Source/WebCore/page/Frame.cpp (179246 => 179247)
--- 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)
@@ -989,7 +989,7 @@
}
if (isMainFrame())
- pageCache()->markPagesForFullStyleRecalc(page);
+ PageCache::shared().markPagesForFullStyleRecalc(page);
}
float Frame::frameScaleFactor() const
Modified: trunk/Source/WebCore/page/Page.cpp (179246 => 179247)
--- 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)
@@ -839,9 +839,9 @@
setNeedsRecalcStyleInAllFrames();
mainFrame().deviceOrPageScaleFactorChanged();
- pageCache()->markPagesForDeviceScaleChanged(this);
+ PageCache::shared().markPagesForDeviceScaleChanged(this);
- pageCache()->markPagesForFullStyleRecalc(this);
+ PageCache::shared().markPagesForFullStyleRecalc(this);
GraphicsContext::updateDocumentMarkerResources();
mainFrame().pageOverlayController().didChangeDeviceScaleFactor();
@@ -921,7 +921,7 @@
m_pagination = pagination;
setNeedsRecalcStyleInAllFrames();
- pageCache()->markPagesForFullStyleRecalc(this);
+ PageCache::shared().markPagesForFullStyleRecalc(this);
}
unsigned Page::pageCount() const
@@ -1661,7 +1661,7 @@
m_visitedLinkStore->addPage(*this);
invalidateStylesForAllLinks();
- pageCache()->markPagesForFullStyleRecalc(this);
+ PageCache::shared().markPagesForFullStyleRecalc(this);
}
SessionID Page::sessionID() const
Modified: trunk/Source/WebCore/page/PageGroup.cpp (179246 => 179247)
--- 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)
@@ -111,7 +111,7 @@
{
for (auto it = m_pages.begin(), end = m_pages.end(); it != end; ++it)
(*it)->captionPreferencesChanged();
- pageCache()->markPagesForCaptionPreferencesChanged();
+ PageCache::shared().markPagesForCaptionPreferencesChanged();
}
CaptionUserPreferences* PageGroup::captionPreferences()
Modified: trunk/Source/WebCore/page/Settings.cpp (179246 => 179247)
--- 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)
@@ -523,7 +523,7 @@
int first = -m_page->backForward().backCount();
int last = m_page->backForward().forwardCount();
for (int i = first; i <= last; i++)
- pageCache()->remove(m_page->backForward().itemAtIndex(i));
+ PageCache::shared().remove(m_page->backForward().itemAtIndex(i));
}
}
Modified: trunk/Source/WebCore/platform/MemoryPressureHandler.cpp (179246 => 179247)
--- 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)
@@ -102,7 +102,7 @@
ReliefLogger log("Empty the PageCache");
// Right now, the only reason we call release critical memory while not under memory pressure is if the process is about to be suspended.
PruningReason pruningReason = memoryPressureHandler().isUnderMemoryPressure() ? PruningReason::MemoryPressure : PruningReason::ProcessSuspended;
- pageCache()->pruneToCapacityNow(0, pruningReason);
+ PageCache::shared().pruneToCapacityNow(0, pruningReason);
}
{
Modified: trunk/Source/WebKit/mac/ChangeLog (179246 => 179247)
--- 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)
@@ -1,3 +1,25 @@
+2015-01-28 Chris Dumez <[email protected]>
+
+ 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:]):
+
2015-01-27 Alexey Proskuryakov <[email protected]>
More build fixes for newer clang.
Modified: trunk/Source/WebKit/mac/History/WebBackForwardList.mm (179246 => 179247)
--- 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)
@@ -355,7 +355,7 @@
- (NSUInteger)pageCacheSize
{
- return [kit(core(self)->page()) usesPageCache] ? pageCache()->capacity() : 0;
+ return [kit(core(self)->page()) usesPageCache] ? PageCache::shared().capacity() : 0;
}
- (int)backListCount
Modified: trunk/Source/WebKit/mac/Misc/WebCoreStatistics.mm (179246 => 179247)
--- 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)
@@ -224,12 +224,12 @@
+ (int)cachedPageCount
{
- return pageCache()->pageCount();
+ return PageCache::shared().pageCount();
}
+ (int)cachedFrameCount
{
- return pageCache()->frameCount();
+ return PageCache::shared().frameCount();
}
// Deprecated
Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebVisitedLinkStore.mm (179246 => 179247)
--- 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)
@@ -74,7 +74,7 @@
{
for (auto& visitedLinkStore : visitedLinkStores())
visitedLinkStore->removeVisitedLinkHashes();
- pageCache()->markPagesForVistedLinkStyleRecalc();
+ PageCache::shared().markPagesForVistedLinkStyleRecalc();
}
void WebVisitedLinkStore::addVisitedLink(NSString *urlString)
@@ -103,7 +103,7 @@
m_visitedLinkHashes.remove(linkHash);
invalidateStylesForLink(linkHash);
- pageCache()->markPagesForVistedLinkStyleRecalc();
+ PageCache::shared().markPagesForVistedLinkStyleRecalc();
}
bool WebVisitedLinkStore::isLinkVisited(Page& page, LinkHash linkHash, const URL& baseURL, const AtomicString& attributeURL)
@@ -152,7 +152,7 @@
m_visitedLinkHashes.add(linkHash);
invalidateStylesForLink(linkHash);
- pageCache()->markPagesForVistedLinkStyleRecalc();
+ PageCache::shared().markPagesForVistedLinkStyleRecalc();
}
void WebVisitedLinkStore::removeVisitedLinkHashes()
Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (179246 => 179247)
--- 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)
@@ -7935,9 +7935,9 @@
memoryCache().setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
memoryCache().setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
- pageCache()->setCapacity(pageCacheCapacity);
+ PageCache::shared().setCapacity(pageCacheCapacity);
#if PLATFORM(IOS)
- pageCache()->setShouldClearBackingStores(true);
+ PageCache::shared().setShouldClearBackingStores(true);
nsurlCacheMemoryCapacity = std::max(nsurlCacheMemoryCapacity, [nsurlCache memoryCapacity]);
CFURLCacheRef cfCache;
if ([nsurlCache respondsToSelector:@selector(_CFURLCache)] && (cfCache = [nsurlCache _CFURLCache]))
Modified: trunk/Source/WebKit/win/ChangeLog (179246 => 179247)
--- 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)
@@ -1,3 +1,22 @@
+2015-01-28 Chris Dumez <[email protected]>
+
+ 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):
+
2015-01-27 Chris Dumez <[email protected]>
Use a Ref<CachedResourceLoader> in Document instead of a RefPtr
Modified: trunk/Source/WebKit/win/WebCoreStatistics.cpp (179246 => 179247)
--- 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)
@@ -327,7 +327,7 @@
if (!count)
return E_POINTER;
- *count = pageCache()->pageCount();
+ *count = PageCache::shared().pageCount();
return S_OK;
}
@@ -336,6 +336,6 @@
if (!count)
return E_POINTER;
- *count = pageCache()->frameCount();
+ *count = PageCache::shared().frameCount();
return S_OK;
}
Modified: trunk/Source/WebKit/win/WebCoreSupport/WebVisitedLinkStore.cpp (179246 => 179247)
--- 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)
@@ -63,7 +63,7 @@
void WebVisitedLinkStore::removeAllVisitedLinks()
{
shared().removeVisitedLinkHashes();
- pageCache()->markPagesForVistedLinkStyleRecalc();
+ PageCache::shared().markPagesForVistedLinkStyleRecalc();
}
void WebVisitedLinkStore::addVisitedLink(const String& urlString)
@@ -116,7 +116,7 @@
m_visitedLinkHashes.add(linkHash);
invalidateStylesForLink(linkHash);
- pageCache()->markPagesForVistedLinkStyleRecalc();
+ PageCache::shared().markPagesForVistedLinkStyleRecalc();
}
void WebVisitedLinkStore::removeVisitedLinkHashes()
Modified: trunk/Source/WebKit/win/WebView.cpp (179246 => 179247)
--- 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)
@@ -675,7 +675,7 @@
memoryCache().setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
memoryCache().setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
- pageCache()->setCapacity(pageCacheCapacity);
+ PageCache::shared().setCapacity(pageCacheCapacity);
#if USE(CFNETWORK)
// Don't shrink a big disk cache, since that would cause churn.
Modified: trunk/Source/WebKit2/ChangeLog (179246 => 179247)
--- 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)
@@ -1,3 +1,28 @@
+2015-01-28 Chris Dumez <[email protected]>
+
+ 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):
+
2015-01-27 Alexey Proskuryakov <[email protected]>
More build fixes for newer clang.
Modified: trunk/Source/WebKit2/WebProcess/WebPage/VisitedLinkTableController.cpp (179246 => 179247)
--- 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)
@@ -97,20 +97,20 @@
m_visitedLinkTable.setSharedMemory(sharedMemory.release());
invalidateStylesForAllLinks();
- pageCache()->markPagesForVistedLinkStyleRecalc();
+ PageCache::shared().markPagesForVistedLinkStyleRecalc();
}
void VisitedLinkTableController::visitedLinkStateChanged(const Vector<WebCore::LinkHash>& linkHashes)
{
for (auto linkHash : linkHashes)
invalidateStylesForLink(linkHash);
- pageCache()->markPagesForVistedLinkStyleRecalc();
+ PageCache::shared().markPagesForVistedLinkStyleRecalc();
}
void VisitedLinkTableController::allVisitedLinkStateChanged()
{
invalidateStylesForAllLinks();
- pageCache()->markPagesForVistedLinkStyleRecalc();
+ PageCache::shared().markPagesForVistedLinkStyleRecalc();
}
void VisitedLinkTableController::removeAllVisitedLinks()
@@ -118,7 +118,7 @@
m_visitedLinkTable.clear();
invalidateStylesForAllLinks();
- pageCache()->markPagesForVistedLinkStyleRecalc();
+ PageCache::shared().markPagesForVistedLinkStyleRecalc();
}
} // namespace WebKit
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebBackForwardListProxy.cpp (179246 => 179247)
--- 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)
@@ -132,7 +132,7 @@
if (!item)
return;
- pageCache()->remove(item.get());
+ PageCache::shared().remove(item.get());
WebCore::Page::clearPreviousItemFromAllPages(item.get());
historyItemToIDMap().remove(item);
}
@@ -218,7 +218,7 @@
{
HashSet<uint64_t>::iterator end = m_associatedItemIDs.end();
for (HashSet<uint64_t>::iterator i = m_associatedItemIDs.begin(); i != end; ++i)
- WebCore::pageCache()->remove(itemForID(*i));
+ WebCore::PageCache::shared().remove(itemForID(*i));
m_associatedItemIDs.clear();
Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (179246 => 179247)
--- 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)
@@ -1116,7 +1116,7 @@
void WebProcess::releasePageCache()
{
- pageCache()->pruneToCapacityNow(0, PruningReason::MemoryPressure);
+ PageCache::shared().pruneToCapacityNow(0, PruningReason::MemoryPressure);
}
#if !PLATFORM(COCOA)
Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm (179246 => 179247)
--- 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)
@@ -115,7 +115,7 @@
memoryCache().setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
memoryCache().setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
- pageCache()->setCapacity(pageCacheCapacity);
+ PageCache::shared().setCapacity(pageCacheCapacity);
NSURLCache *nsurlCache = [NSURLCache sharedURLCache];
Modified: trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp (179246 => 179247)
--- 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)
@@ -104,10 +104,10 @@
WebCore::memoryCache().setDisabled(cacheModel == CacheModelDocumentViewer);
WebCore::memoryCache().setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
WebCore::memoryCache().setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
- WebCore::pageCache()->setCapacity(pageCacheCapacity);
+ WebCore::PageCache::shared().setCapacity(pageCacheCapacity);
#if PLATFORM(GTK)
- WebCore::pageCache()->setShouldClearBackingStores(true);
+ WebCore::PageCache::shared().setShouldClearBackingStores(true);
#endif
if (!usesNetworkProcess()) {