<!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>[179489] 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/179489">179489</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-02-02 12:50:16 -0800 (Mon, 02 Feb 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Access MemoryCache singleton using MemoryCache::singleton()
https://bugs.webkit.org/show_bug.cgi?id=141104
Reviewed by Andreas Kling.
Access MemoryCache singleton using MemoryCache::singleton() static
member function, instead of a free function, as per the recent
coding style discussion on WebKit-dev.</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="#trunkSourceWebCoreinspectorInspectorPageAgentcpp">trunk/Source/WebCore/inspector/InspectorPageAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorResourceAgentcpp">trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoadercpp">trunk/Source/WebCore/loader/DocumentLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoadercpp">trunk/Source/WebCore/loader/FrameLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderSubresourceLoadercpp">trunk/Source/WebCore/loader/SubresourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderarchivecfLegacyWebArchivecpp">trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedImagecpp">trunk/Source/WebCore/loader/cache/CachedImage.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourcecpp">trunk/Source/WebCore/loader/cache/CachedResource.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceLoadercpp">trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheMemoryCachecpp">trunk/Source/WebCore/loader/cache/MemoryCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheMemoryCacheh">trunk/Source/WebCore/loader/cache/MemoryCache.h</a></li>
<li><a href="#trunkSourceWebCoreloadercocoaDiskCacheMonitorCocoamm">trunk/Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.mm</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformMemoryPressureHandlercpp">trunk/Source/WebCore/platform/MemoryPressureHandler.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacMiscWebCachemm">trunk/Source/WebKit/mac/Misc/WebCache.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="#trunkSourceWebKitwinWebCachecpp">trunk/Source/WebKit/win/WebCache.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="#trunkSourceWebKit2WebProcessNetworkNetworkProcessConnectioncpp">trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessResourceCacheWebResourceCacheManagercpp">trunk/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.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 (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebCore/ChangeLog        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-02-02 Chris Dumez <cdumez@apple.com>
+
+ Access MemoryCache singleton using MemoryCache::singleton()
+ https://bugs.webkit.org/show_bug.cgi?id=141104
+
+ Reviewed by Andreas Kling.
+
+ Access MemoryCache singleton using MemoryCache::singleton() static
+ member function, instead of a free function, as per the recent
+ coding style discussion on WebKit-dev.
+
</ins><span class="cx"> 2015-02-02 Zalan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><span class="cx"> Ambiguous naming: Do not call replacedContentRect()'s return value paint rect.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebCore/WebCore.exp.in        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -198,6 +198,7 @@
</span><span class="cx"> __ZN7WebCore11MemoryCache19getOriginsWithCacheERN3WTF7HashSetINS1_6RefPtrINS_14SecurityOriginEEENS_18SecurityOriginHashENS1_10HashTraitsIS5_EEEE
</span><span class="cx"> __ZN7WebCore11MemoryCache20removeImageFromCacheERKNS_3URLERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore11MemoryCache25removeResourcesWithOriginERNS_14SecurityOriginE
</span><ins>+__ZN7WebCore11MemoryCache9singletonEv
</ins><span class="cx"> __ZN7WebCore11PageOverlay15setNeedsDisplayERKNS_7IntRectE
</span><span class="cx"> __ZN7WebCore11PageOverlay15setNeedsDisplayEv
</span><span class="cx"> __ZN7WebCore11PageOverlay20stopFadeOutAnimationEv
</span><span class="lines">@@ -211,7 +212,6 @@
</span><span class="cx"> __ZN7WebCore11getURLBytesEPK7__CFURLRN3WTF6VectorIcLm512ENS3_15CrashOnOverflowEEE
</span><span class="cx"> __ZN7WebCore11getURLBytesEPK7__CFURLRN3WTF7CStringE
</span><span class="cx"> __ZN7WebCore11iBeamCursorEv
</span><del>-__ZN7WebCore11memoryCacheEv
</del><span class="cx"> __ZN7WebCore11startOfLineERKNS_15VisiblePositionE
</span><span class="cx"> __ZN7WebCore11startOfWordERKNS_15VisiblePositionENS_9EWordSideE
</span><span class="cx"> __ZN7WebCore11writeToFileEiPKci
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorPageAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -261,7 +261,7 @@
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><span class="cx"> request.setDomainForCachePartition(frame->document()->topOrigin()->domainForCachePartition());
</span><span class="cx"> #endif
</span><del>- cachedResource = memoryCache().resourceForRequest(request, frame->page()->sessionID());
</del><ins>+ cachedResource = MemoryCache::singleton().resourceForRequest(request, frame->page()->sessionID());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return cachedResource;
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorResourceAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -708,9 +708,9 @@
</span><span class="cx"> request.setDomainForCachePartition(m_pageAgent->mainFrame()->document()->topOrigin()->domainForCachePartition());
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- CachedResource* cachedResource = memoryCache().resourceForRequest(request, m_pageAgent->page()->sessionID());
- if (cachedResource)
- memoryCache().remove(*cachedResource);
</del><ins>+ auto& memoryCache = MemoryCache::singleton();
+ if (CachedResource* cachedResource = memoryCache.resourceForRequest(request, m_pageAgent->page()->sessionID()))
+ memoryCache.remove(*cachedResource);
</ins><span class="cx">
</span><span class="cx"> xhr->open(xhrReplayData->method(), xhrReplayData->url(), xhrReplayData->async(), IGNORE_EXCEPTION);
</span><span class="cx"> for (const auto& header : xhrReplayData->headers())
</span><span class="lines">@@ -742,7 +742,7 @@
</span><span class="cx"> {
</span><span class="cx"> m_cacheDisabled = cacheDisabled;
</span><span class="cx"> if (cacheDisabled)
</span><del>- memoryCache().evictResources();
</del><ins>+ MemoryCache::singleton().evictResources();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorResourceAgent::loadResource(ErrorString& errorString, const String& frameId, const String& urlString, Ref<LoadResourceCallback>&& callback)
</span><span class="lines">@@ -788,7 +788,7 @@
</span><span class="cx"> void InspectorResourceAgent::mainFrameNavigated(DocumentLoader& loader)
</span><span class="cx"> {
</span><span class="cx"> if (m_cacheDisabled)
</span><del>- memoryCache().evictResources();
</del><ins>+ MemoryCache::singleton().evictResources();
</ins><span class="cx">
</span><span class="cx"> m_resourcesData->clear(m_pageAgent->loaderId(&loader));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx"> if (!loader->frameLoader())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- CachedResource* cachedResource = memoryCache().resourceForURL(handle->firstRequest().url(), loader->frameLoader()->frame().page()->sessionID());
</del><ins>+ CachedResource* cachedResource = MemoryCache::singleton().resourceForURL(handle->firstRequest().url(), loader->frameLoader()->frame().page()->sessionID());
</ins><span class="cx"> if (!cachedResource)
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="lines">@@ -448,7 +448,7 @@
</span><span class="cx"> // and deny the appcache the chance to intercept it in the future, so remove from the memory cache.
</span><span class="cx"> if (m_frame) {
</span><span class="cx"> if (m_mainResource && m_frame->document()->hasManifest())
</span><del>- memoryCache().remove(*m_mainResource);
</del><ins>+ MemoryCache::singleton().remove(*m_mainResource);
</ins><span class="cx"> }
</span><span class="cx"> m_applicationCacheHost->finishedLoadingMainResource();
</span><span class="cx"> }
</span><span class="lines">@@ -599,7 +599,7 @@
</span><span class="cx"> // The memory cache doesn't understand the application cache or its caching rules. So if a main resource is served
</span><span class="cx"> // from the application cache, ensure we don't save the result for future use.
</span><span class="cx"> if (willLoadFallback)
</span><del>- memoryCache().remove(*m_mainResource);
</del><ins>+ MemoryCache::singleton().remove(*m_mainResource);
</ins><span class="cx">
</span><span class="cx"> if (willLoadFallback)
</span><span class="cx"> return;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -3390,7 +3390,7 @@
</span><span class="cx">
</span><span class="cx"> size_t size = pastLoads.size();
</span><span class="cx"> for (size_t i = 0; i < size; ++i) {
</span><del>- CachedResource* resource = memoryCache().resourceForRequest(pastLoads[i], m_frame.page()->sessionID());
</del><ins>+ CachedResource* resource = MemoryCache::singleton().resourceForRequest(pastLoads[i], m_frame.page()->sessionID());
</ins><span class="cx">
</span><span class="cx"> // FIXME: These loads, loaded from cache, but now gone from the cache by the time
</span><span class="cx"> // Page::setMemoryCacheClientCallsEnabled(true) is called, will not be seen by the client.
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderSubresourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/SubresourceLoader.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/SubresourceLoader.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebCore/loader/SubresourceLoader.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -159,7 +159,7 @@
</span><span class="cx"> // Doing so would have us reusing the resource from the first request if the second request's revalidation succeeds.
</span><span class="cx"> if (newRequest.isConditional() && m_resource->resourceToRevalidate() && newRequest.url() != m_resource->resourceToRevalidate()->response().url()) {
</span><span class="cx"> newRequest.makeUnconditional();
</span><del>- memoryCache().revalidationFailed(*m_resource);
</del><ins>+ MemoryCache::singleton().revalidationFailed(*m_resource);
</ins><span class="cx"> if (m_frame)
</span><span class="cx"> m_frame->mainFrame().diagnosticLoggingClient().logDiagnosticMessageWithResult(DiagnosticLoggingKeys::cachedResourceRevalidationKey(), emptyString(), DiagnosticLoggingResultFail);
</span><span class="cx"> }
</span><span class="lines">@@ -207,7 +207,7 @@
</span><span class="cx"> // 304 Not modified / Use local copy
</span><span class="cx"> // Existing resource is ok, just use it updating the expiration time.
</span><span class="cx"> m_resource->setResponse(response);
</span><del>- memoryCache().revalidationSucceeded(*m_resource, response);
</del><ins>+ MemoryCache::singleton().revalidationSucceeded(*m_resource, response);
</ins><span class="cx"> if (m_frame)
</span><span class="cx"> m_frame->mainFrame().diagnosticLoggingClient().logDiagnosticMessageWithResult(DiagnosticLoggingKeys::cachedResourceRevalidationKey(), emptyString(), DiagnosticLoggingResultPass);
</span><span class="cx"> if (!reachedTerminalState())
</span><span class="lines">@@ -215,7 +215,7 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> // Did not get 304 response, continue as a regular resource load.
</span><del>- memoryCache().revalidationFailed(*m_resource);
</del><ins>+ MemoryCache::singleton().revalidationFailed(*m_resource);
</ins><span class="cx"> if (m_frame)
</span><span class="cx"> m_frame->mainFrame().diagnosticLoggingClient().logDiagnosticMessageWithResult(DiagnosticLoggingKeys::cachedResourceRevalidationKey(), emptyString(), DiagnosticLoggingResultFail);
</span><span class="cx"> }
</span><span class="lines">@@ -385,10 +385,10 @@
</span><span class="cx"> CachedResourceHandle<CachedResource> protectResource(m_resource);
</span><span class="cx"> m_state = Finishing;
</span><span class="cx"> if (m_resource->resourceToRevalidate())
</span><del>- memoryCache().revalidationFailed(*m_resource);
</del><ins>+ MemoryCache::singleton().revalidationFailed(*m_resource);
</ins><span class="cx"> m_resource->setResourceError(error);
</span><span class="cx"> if (!m_resource->isPreloaded())
</span><del>- memoryCache().remove(*m_resource);
</del><ins>+ MemoryCache::singleton().remove(*m_resource);
</ins><span class="cx"> m_resource->error(CachedResource::LoadError);
</span><span class="cx"> cleanupForError(error);
</span><span class="cx"> notifyDone();
</span><span class="lines">@@ -417,10 +417,11 @@
</span><span class="cx"> #else
</span><span class="cx"> m_state = Finishing;
</span><span class="cx"> #endif
</span><ins>+ auto& memoryCache = MemoryCache::singleton();
</ins><span class="cx"> if (m_resource->resourceToRevalidate())
</span><del>- memoryCache().revalidationFailed(*m_resource);
</del><ins>+ memoryCache.revalidationFailed(*m_resource);
</ins><span class="cx"> m_resource->setResourceError(error);
</span><del>- memoryCache().remove(*m_resource);
</del><ins>+ memoryCache.remove(*m_resource);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void SubresourceLoader::didCancel(const ResourceError&)
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderarchivecfLegacyWebArchivecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -547,7 +547,7 @@
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><span class="cx"> request.setDomainForCachePartition(frame->document()->topOrigin()->domainForCachePartition());
</span><span class="cx"> #endif
</span><del>- CachedResource* cachedResource = memoryCache().resourceForRequest(request, frame->page()->sessionID());
</del><ins>+ CachedResource* cachedResource = MemoryCache::singleton().resourceForRequest(request, frame->page()->sessionID());
</ins><span class="cx"> if (cachedResource) {
</span><span class="cx"> if (RefPtr<ArchiveResource> resource = ArchiveResource::create(cachedResource->resourceBuffer(), subresourceURL, cachedResource->response())) {
</span><span class="cx"> subresources.append(WTF::move(resource));
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedImage.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedImage.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebCore/loader/cache/CachedImage.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -381,7 +381,7 @@
</span><span class="cx"> // Image decoding failed. Either we need more image data or the image data is malformed.
</span><span class="cx"> error(errorOccurred() ? status() : DecodeError);
</span><span class="cx"> if (inCache())
</span><del>- memoryCache().remove(*this);
</del><ins>+ MemoryCache::singleton().remove(*this);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -422,7 +422,7 @@
</span><span class="cx"> // Image decoding failed; the image data is malformed.
</span><span class="cx"> error(errorOccurred() ? status() : DecodeError);
</span><span class="cx"> if (inCache())
</span><del>- memoryCache().remove(*this);
</del><ins>+ MemoryCache::singleton().remove(*this);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResource.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResource.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx"> if (type == CachedResource::Script)
</span><span class="cx"> return std::chrono::milliseconds { 0 };
</span><span class="cx">
</span><del>- return memoryCache().deadDecodedDataDeletionInterval();
</del><ins>+ return MemoryCache::singleton().deadDecodedDataDeletionInterval();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> DEFINE_DEBUG_ONLY_GLOBAL(RefCountedLeakCounter, cachedResourceLeakCounter, ("CachedResource"));
</span><span class="lines">@@ -162,7 +162,7 @@
</span><span class="cx"> ASSERT(canDelete());
</span><span class="cx"> ASSERT(!inCache());
</span><span class="cx"> ASSERT(!m_deleted);
</span><del>- ASSERT(url().isNull() || memoryCache().resourceForRequest(resourceRequest(), sessionID()) != this);
</del><ins>+ ASSERT(url().isNull() || MemoryCache::singleton().resourceForRequest(resourceRequest(), sessionID()) != this);
</ins><span class="cx">
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> m_deleted = true;
</span><span class="lines">@@ -178,7 +178,7 @@
</span><span class="cx"> // FIXME: What if resources in other frames were waiting for this revalidation?
</span><span class="cx"> LOG(ResourceLoading, "Cannot start loading '%s'", url().string().latin1().data());
</span><span class="cx"> if (m_resourceToRevalidate)
</span><del>- memoryCache().revalidationFailed(*this);
</del><ins>+ MemoryCache::singleton().revalidationFailed(*this);
</ins><span class="cx"> error(CachedResource::LoadError);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -415,7 +415,7 @@
</span><span class="cx"> m_preloadResult = PreloadReferenced;
</span><span class="cx"> }
</span><span class="cx"> if (!hasClients() && inCache())
</span><del>- memoryCache().addToLiveResourcesSize(*this);
</del><ins>+ MemoryCache::singleton().addToLiveResourcesSize(*this);
</ins><span class="cx">
</span><span class="cx"> if ((m_type == RawResource || m_type == MainResource) && !m_response.isNull() && !m_proxyResource) {
</span><span class="cx"> // Certain resources (especially XHRs and main resources) do crazy things if an asynchronous load returns
</span><span class="lines">@@ -446,9 +446,10 @@
</span><span class="cx">
</span><span class="cx"> bool deleted = deleteIfPossible();
</span><span class="cx"> if (!deleted && !hasClients()) {
</span><ins>+ auto& memoryCache = MemoryCache::singleton();
</ins><span class="cx"> if (inCache()) {
</span><del>- memoryCache().removeFromLiveResourcesSize(*this);
- memoryCache().removeFromLiveDecodedResourcesList(*this);
</del><ins>+ memoryCache.removeFromLiveResourcesSize(*this);
+ memoryCache.removeFromLiveDecodedResourcesList(*this);
</ins><span class="cx"> }
</span><span class="cx"> if (!m_switchingClientsToRevalidatedResource)
</span><span class="cx"> allClientsRemoved();
</span><span class="lines">@@ -458,9 +459,9 @@
</span><span class="cx"> // "no-store: ... MUST make a best-effort attempt to remove the information from volatile storage as promptly as possible"
</span><span class="cx"> // "... History buffers MAY store such responses as part of their normal operation."
</span><span class="cx"> // We allow non-secure content to be reused in history, but we do not allow secure content to be reused.
</span><del>- memoryCache().remove(*this);
</del><ins>+ memoryCache.remove(*this);
</ins><span class="cx"> }
</span><del>- memoryCache().prune();
</del><ins>+ memoryCache.prune();
</ins><span class="cx"> }
</span><span class="cx"> // This object may be dead here.
</span><span class="cx"> }
</span><span class="lines">@@ -469,7 +470,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (!m_decodedSize)
</span><span class="cx"> return;
</span><del>- if (!memoryCache().deadDecodedDataDeletionInterval().count())
</del><ins>+ if (!MemoryCache::singleton().deadDecodedDataDeletionInterval().count())
</ins><span class="cx"> return;
</span><span class="cx"> m_decodedDataDeletionTimer.restart();
</span><span class="cx"> }
</span><span class="lines">@@ -499,13 +500,14 @@
</span><span class="cx"> // The object must be moved to a different queue, since its size has been changed.
</span><span class="cx"> // Remove before updating m_decodedSize, so we find the resource in the correct LRU list.
</span><span class="cx"> if (inCache())
</span><del>- memoryCache().removeFromLRUList(*this);
</del><ins>+ MemoryCache::singleton().removeFromLRUList(*this);
</ins><span class="cx">
</span><span class="cx"> m_decodedSize = size;
</span><span class="cx">
</span><del>- if (inCache()) {
</del><ins>+ if (inCache()) {
+ auto& memoryCache = MemoryCache::singleton();
</ins><span class="cx"> // Now insert into the new LRU list.
</span><del>- memoryCache().insertInLRUList(*this);
</del><ins>+ memoryCache.insertInLRUList(*this);
</ins><span class="cx">
</span><span class="cx"> // Insert into or remove from the live decoded list if necessary.
</span><span class="cx"> // When inserting into the LiveDecodedResourcesList it is possible
</span><span class="lines">@@ -514,14 +516,14 @@
</span><span class="cx"> // violation of the invariant that the list is to be kept sorted
</span><span class="cx"> // by access time. The weakening of the invariant does not pose
</span><span class="cx"> // a problem. For more details please see: https://bugs.webkit.org/show_bug.cgi?id=30209
</span><del>- bool inLiveDecodedResourcesList = memoryCache().inLiveDecodedResourcesList(*this);
</del><ins>+ bool inLiveDecodedResourcesList = memoryCache.inLiveDecodedResourcesList(*this);
</ins><span class="cx"> if (m_decodedSize && !inLiveDecodedResourcesList && hasClients())
</span><del>- memoryCache().insertInLiveDecodedResourcesList(*this);
</del><ins>+ memoryCache.insertInLiveDecodedResourcesList(*this);
</ins><span class="cx"> else if (!m_decodedSize && inLiveDecodedResourcesList)
</span><del>- memoryCache().removeFromLiveDecodedResourcesList(*this);
</del><ins>+ memoryCache.removeFromLiveDecodedResourcesList(*this);
</ins><span class="cx">
</span><span class="cx"> // Update the cache's size totals.
</span><del>- memoryCache().adjustSize(hasClients(), delta);
</del><ins>+ memoryCache.adjustSize(hasClients(), delta);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -535,13 +537,14 @@
</span><span class="cx"> // The object must be moved to a different queue, since its size has been changed.
</span><span class="cx"> // Remove before updating m_encodedSize, so we find the resource in the correct LRU list.
</span><span class="cx"> if (inCache())
</span><del>- memoryCache().removeFromLRUList(*this);
</del><ins>+ MemoryCache::singleton().removeFromLRUList(*this);
</ins><span class="cx">
</span><span class="cx"> m_encodedSize = size;
</span><span class="cx">
</span><del>- if (inCache()) {
- memoryCache().insertInLRUList(*this);
- memoryCache().adjustSize(hasClients(), delta);
</del><ins>+ if (inCache()) {
+ auto& memoryCache = MemoryCache::singleton();
+ memoryCache.insertInLRUList(*this);
+ memoryCache.adjustSize(hasClients(), delta);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -550,11 +553,12 @@
</span><span class="cx"> m_lastDecodedAccessTime = timeStamp;
</span><span class="cx">
</span><span class="cx"> if (inCache()) {
</span><del>- if (memoryCache().inLiveDecodedResourcesList(*this)) {
- memoryCache().removeFromLiveDecodedResourcesList(*this);
- memoryCache().insertInLiveDecodedResourcesList(*this);
</del><ins>+ auto& memoryCache = MemoryCache::singleton();
+ if (memoryCache.inLiveDecodedResourcesList(*this)) {
+ memoryCache.removeFromLiveDecodedResourcesList(*this);
+ memoryCache.insertInLiveDecodedResourcesList(*this);
</ins><span class="cx"> }
</span><del>- memoryCache().prune();
</del><ins>+ memoryCache.prune();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -215,17 +215,18 @@
</span><span class="cx"> request.mutableResourceRequest().setDomainForCachePartition(document()->topOrigin()->domainForCachePartition());
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- if (CachedResource* existing = memoryCache().resourceForRequest(request.resourceRequest(), sessionID())) {
</del><ins>+ auto& memoryCache = MemoryCache::singleton();
+ if (CachedResource* existing = memoryCache.resourceForRequest(request.resourceRequest(), sessionID())) {
</ins><span class="cx"> if (is<CachedCSSStyleSheet>(*existing))
</span><span class="cx"> return downcast<CachedCSSStyleSheet>(existing);
</span><del>- memoryCache().remove(*existing);
</del><ins>+ memoryCache.remove(*existing);
</ins><span class="cx"> }
</span><span class="cx"> if (url.string() != request.resourceRequest().url())
</span><span class="cx"> request.mutableResourceRequest().setURL(url);
</span><span class="cx">
</span><span class="cx"> CachedResourceHandle<CachedCSSStyleSheet> userSheet = new CachedCSSStyleSheet(request.resourceRequest(), request.charset(), sessionID());
</span><span class="cx">
</span><del>- memoryCache().add(*userSheet);
</del><ins>+ memoryCache.add(*userSheet);
</ins><span class="cx"> // FIXME: loadResource calls setOwningCachedResourceLoader() if the resource couldn't be added to cache. Does this function need to call it, too?
</span><span class="cx">
</span><span class="cx"> userSheet->load(*this, ResourceLoaderOptions(DoNotSendCallbacks, SniffContent, BufferData, AllowStoredCredentials, AskClientForAllCredentials, SkipSecurityCheck, UseDefaultOriginRestrictionsForType, DoNotIncludeCertificateInfo));
</span><span class="lines">@@ -467,7 +468,8 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- if (memoryCache().disabled()) {
</del><ins>+ auto& memoryCache = MemoryCache::singleton();
+ if (memoryCache.disabled()) {
</ins><span class="cx"> DocumentResourceMap::iterator it = m_documentResources.find(url.string());
</span><span class="cx"> if (it != m_documentResources.end()) {
</span><span class="cx"> it->value->setOwningCachedResourceLoader(0);
</span><span class="lines">@@ -482,14 +484,14 @@
</span><span class="cx"> request.mutableResourceRequest().setDomainForCachePartition(document()->topOrigin()->domainForCachePartition());
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- resource = memoryCache().resourceForRequest(request.resourceRequest(), sessionID());
</del><ins>+ resource = memoryCache.resourceForRequest(request.resourceRequest(), sessionID());
</ins><span class="cx">
</span><span class="cx"> logMemoryCacheResourceRequest(frame(), resource ? DiagnosticLoggingKeys::inMemoryCacheKey() : DiagnosticLoggingKeys::notInMemoryCacheKey());
</span><span class="cx">
</span><span class="cx"> const RevalidationPolicy policy = determineRevalidationPolicy(type, request.mutableResourceRequest(), request.forPreload(), resource.get(), request.defer());
</span><span class="cx"> switch (policy) {
</span><span class="cx"> case Reload:
</span><del>- memoryCache().remove(*resource);
</del><ins>+ memoryCache.remove(*resource);
</ins><span class="cx"> FALLTHROUGH;
</span><span class="cx"> case Load:
</span><span class="cx"> if (resource)
</span><span class="lines">@@ -505,7 +507,7 @@
</span><span class="cx"> if (!shouldContinueAfterNotifyingLoadedFromMemoryCache(request, resource.get()))
</span><span class="cx"> return nullptr;
</span><span class="cx"> logMemoryCacheResourceRequest(frame(), DiagnosticLoggingKeys::inMemoryCacheKey(), DiagnosticLoggingKeys::usedKey());
</span><del>- memoryCache().resourceAccessed(*resource);
</del><ins>+ memoryCache.resourceAccessed(*resource);
</ins><span class="cx"> break;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -521,7 +523,7 @@
</span><span class="cx"> // We don't support immediate loads, but we do support immediate failure.
</span><span class="cx"> if (resource->errorOccurred()) {
</span><span class="cx"> if (resource->inCache())
</span><del>- memoryCache().remove(*resource);
</del><ins>+ memoryCache.remove(*resource);
</ins><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -543,20 +545,19 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(resource);
</span><span class="cx"> ASSERT(resource->inCache());
</span><del>- ASSERT(!memoryCache().disabled());
</del><ins>+ auto& memoryCache = MemoryCache::singleton();
+ ASSERT(!memoryCache.disabled());
</ins><span class="cx"> ASSERT(resource->canUseCacheValidator());
</span><span class="cx"> ASSERT(!resource->resourceToRevalidate());
</span><span class="cx"> ASSERT(resource->sessionID() == sessionID());
</span><span class="cx">
</span><del>- // Copy the URL out of the resource to be revalidated in case it gets deleted by the remove() call below.
- String url = resource->url();
</del><span class="cx"> CachedResourceHandle<CachedResource> newResource = createResource(resource->type(), resource->resourceRequest(), resource->encoding(), resource->sessionID());
</span><span class="cx">
</span><span class="cx"> LOG(ResourceLoading, "Resource %p created to revalidate %p", newResource.get(), resource);
</span><span class="cx"> newResource->setResourceToRevalidate(resource);
</span><span class="cx">
</span><del>- memoryCache().remove(*resource);
- memoryCache().add(*newResource);
</del><ins>+ memoryCache.remove(*resource);
+ memoryCache.add(*newResource);
</ins><span class="cx"> #if ENABLE(RESOURCE_TIMING)
</span><span class="cx"> storeResourceTimingInitiatorInformation(resource, request);
</span><span class="cx"> #else
</span><span class="lines">@@ -567,13 +568,14 @@
</span><span class="cx">
</span><span class="cx"> CachedResourceHandle<CachedResource> CachedResourceLoader::loadResource(CachedResource::Type type, CachedResourceRequest& request)
</span><span class="cx"> {
</span><del>- ASSERT(!memoryCache().resourceForRequest(request.resourceRequest(), sessionID()));
</del><ins>+ auto& memoryCache = MemoryCache::singleton();
+ ASSERT(!memoryCache.resourceForRequest(request.resourceRequest(), sessionID()));
</ins><span class="cx">
</span><span class="cx"> LOG(ResourceLoading, "Loading CachedResource for '%s'.", request.resourceRequest().url().stringCenterEllipsizedToLength().latin1().data());
</span><span class="cx">
</span><span class="cx"> CachedResourceHandle<CachedResource> resource = createResource(type, request.mutableResourceRequest(), request.charset(), sessionID());
</span><span class="cx">
</span><del>- if (!memoryCache().add(*resource))
</del><ins>+ if (!memoryCache.add(*resource))
</ins><span class="cx"> resource->setOwningCachedResourceLoader(this);
</span><span class="cx"> #if ENABLE(RESOURCE_TIMING)
</span><span class="cx"> storeResourceTimingInitiatorInformation(resource, request);
</span><span class="lines">@@ -803,7 +805,7 @@
</span><span class="cx"> {
</span><span class="cx"> m_documentResources.set(resource.url(), &resource);
</span><span class="cx">
</span><del>- if (!memoryCache().add(resource))
</del><ins>+ if (!MemoryCache::singleton().add(resource))
</ins><span class="cx"> resource.setOwningCachedResourceLoader(this);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -989,7 +991,7 @@
</span><span class="cx"> resource->decreasePreloadCount();
</span><span class="cx"> bool deleted = resource->deleteIfPossible();
</span><span class="cx"> if (!deleted && resource->preloadResult() == CachedResource::PreloadNotReferenced)
</span><del>- memoryCache().remove(*resource);
</del><ins>+ MemoryCache::singleton().remove(*resource);
</ins><span class="cx"> }
</span><span class="cx"> m_preloads = nullptr;
</span><span class="cx"> }
</span><span class="lines">@@ -1033,7 +1035,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (res->errorOccurred())
</span><del>- memoryCache().remove(res);
</del><ins>+ MemoryCache::singleton().remove(res);
</ins><span class="cx">
</span><span class="cx"> res->decreasePreloadCount();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheMemoryCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/MemoryCache.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/MemoryCache.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -53,12 +53,10 @@
</span><span class="cx"> static const float cTargetPrunePercentage = .95f; // Percentage of capacity toward which we prune, to avoid immediately pruning again.
</span><span class="cx"> static const auto defaultDecodedDataDeletionInterval = std::chrono::seconds { 0 };
</span><span class="cx">
</span><del>-MemoryCache& memoryCache()
</del><ins>+MemoryCache& MemoryCache::singleton()
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(WTF::isMainThread());
</span><del>-
</del><span class="cx"> static NeverDestroyed<MemoryCache> memoryCache;
</span><del>-
</del><span class="cx"> return memoryCache;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -639,9 +637,10 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- for (auto& resources : memoryCache().m_sessionResources) {
- if (CachedResource* resource = memoryCache().resourceForRequestImpl(request, *resources.value))
- memoryCache().remove(*resource);
</del><ins>+ auto& memoryCache = MemoryCache::singleton();
+ for (auto& resources : memoryCache.m_sessionResources) {
+ if (CachedResource* resource = memoryCache.resourceForRequestImpl(request, *resources.value))
+ memoryCache.remove(*resource);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheMemoryCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/MemoryCache.h (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/MemoryCache.h        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.h        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -61,9 +61,9 @@
</span><span class="cx">
</span><span class="cx"> class MemoryCache {
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(MemoryCache); WTF_MAKE_FAST_ALLOCATED;
</span><del>-public:
</del><span class="cx"> friend NeverDestroyed<MemoryCache>;
</span><span class="cx">
</span><ins>+public:
</ins><span class="cx"> struct TypeStatistic {
</span><span class="cx"> int count;
</span><span class="cx"> int size;
</span><span class="lines">@@ -89,6 +89,8 @@
</span><span class="cx"> TypeStatistic fonts;
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+ WEBCORE_EXPORT static MemoryCache& singleton();
+
</ins><span class="cx"> WEBCORE_EXPORT CachedResource* resourceForURL(const URL&, SessionID = SessionID::defaultSessionID());
</span><span class="cx"> WEBCORE_EXPORT CachedResource* resourceForRequest(const ResourceRequest&, SessionID);
</span><span class="cx">
</span><span class="lines">@@ -214,9 +216,6 @@
</span><span class="cx"> SessionCachedResourceMap m_sessionResources;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-// Function to obtain the global cache.
-WEBCORE_EXPORT MemoryCache& memoryCache();
-
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercocoaDiskCacheMonitorCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.mm (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.mm        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebCore/loader/cocoa/DiskCacheMonitorCocoa.mm        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -112,7 +112,7 @@
</span><span class="cx">
</span><span class="cx"> void DiskCacheMonitor::resourceBecameFileBacked(SharedBuffer& fileBackedBuffer)
</span><span class="cx"> {
</span><del>- CachedResource* resource = memoryCache().resourceForRequest(m_resourceRequest, m_sessionID);
</del><ins>+ CachedResource* resource = MemoryCache::singleton().resourceForRequest(m_resourceRequest, m_sessionID);
</ins><span class="cx"> if (!resource)
</span><span class="cx"> return;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebCore/page/FrameView.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -3761,7 +3761,7 @@
</span><span class="cx">
</span><span class="cx"> // To avoid unnecessary image decoding, we don't prune recently-decoded live resources here since
</span><span class="cx"> // we might need some live bitmaps on painting.
</span><del>- memoryCache().prune();
</del><ins>+ MemoryCache::singleton().prune();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (paintingState.isTopLevelPainter)
</span><span class="lines">@@ -3801,7 +3801,7 @@
</span><span class="cx"> // Painting can lead to decoding of large amounts of bitmaps
</span><span class="cx"> // If we are low on memory, wipe them out after the paint.
</span><span class="cx"> if (paintingState.isTopLevelPainter && memoryPressureHandler().isUnderMemoryPressure())
</span><del>- memoryCache().pruneLiveResources(true);
</del><ins>+ MemoryCache::singleton().pruneLiveResources(true);
</ins><span class="cx">
</span><span class="cx"> // Regions may have changed as a result of the visibility/z-index of element changing.
</span><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformMemoryPressureHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/MemoryPressureHandler.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/MemoryPressureHandler.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebCore/platform/MemoryPressureHandler.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -107,7 +107,7 @@
</span><span class="cx">
</span><span class="cx"> {
</span><span class="cx"> ReliefLogger log("Prune MemoryCache");
</span><del>- memoryCache().evictResources();
</del><ins>+ MemoryCache::singleton().evictResources();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebCore/testing/Internals.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -380,7 +380,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (!contextDocument() || !contextDocument()->page())
</span><span class="cx"> return false;
</span><del>- CachedResource* resource = memoryCache().resourceForURL(contextDocument()->completeURL(url), contextDocument()->page()->sessionID());
</del><ins>+ CachedResource* resource = MemoryCache::singleton().resourceForURL(contextDocument()->completeURL(url), contextDocument()->page()->sessionID());
</ins><span class="cx"> return resource && resource->status() == CachedResource::Cached;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -406,7 +406,7 @@
</span><span class="cx">
</span><span class="cx"> void Internals::clearMemoryCache()
</span><span class="cx"> {
</span><del>- memoryCache().evictResources();
</del><ins>+ MemoryCache::singleton().evictResources();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Node* Internals::treeScopeRootNode(Node* node, ExceptionCode& ec)
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebKit/mac/ChangeLog        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-02-02 Chris Dumez <cdumez@apple.com>
+
+ Access MemoryCache singleton using MemoryCache::singleton()
+ https://bugs.webkit.org/show_bug.cgi?id=141104
+
+ Reviewed by Andreas Kling.
+
+ Access MemoryCache singleton using MemoryCache::singleton() static
+ member function, instead of a free function, as per the recent
+ coding style discussion on WebKit-dev.
+
</ins><span class="cx"> 2015-02-01 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Use more references in HistoryItem
</span></span></pre></div>
<a id="trunkSourceWebKitmacMiscWebCachemm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Misc/WebCache.mm (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Misc/WebCache.mm        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebKit/mac/Misc/WebCache.mm        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx">
</span><span class="cx"> + (NSArray *)statistics
</span><span class="cx"> {
</span><del>- WebCore::MemoryCache::Statistics s = WebCore::memoryCache().getStatistics();
</del><ins>+ WebCore::MemoryCache::Statistics s = WebCore::MemoryCache::singleton().getStatistics();
</ins><span class="cx">
</span><span class="cx"> return [NSArray arrayWithObjects:
</span><span class="cx"> [NSDictionary dictionaryWithObjectsAndKeys:
</span><span class="lines">@@ -140,13 +140,13 @@
</span><span class="cx"> [WebView _setCacheModel:WebCacheModelDocumentViewer];
</span><span class="cx"> [WebView _setCacheModel:cacheModel];
</span><span class="cx">
</span><del>- WebCore::memoryCache().pruneLiveResources(true);
</del><ins>+ WebCore::MemoryCache::singleton().pruneLiveResources(true);
</ins><span class="cx"> });
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> + (void)sizeOfDeadResources:(int *)resources
</span><span class="cx"> {
</span><del>- WebCore::MemoryCache::Statistics stats = WebCore::memoryCache().getStatistics();
</del><ins>+ WebCore::MemoryCache::Statistics stats = WebCore::MemoryCache::singleton().getStatistics();
</ins><span class="cx"> if (resources) {
</span><span class="cx"> *resources = (stats.images.size - stats.images.liveSize)
</span><span class="cx"> + (stats.cssStyleSheets.size - stats.cssStyleSheets.liveSize)
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx"> if (frame)
</span><span class="cx"> topOrigin = core(frame)->document()->topOrigin();
</span><span class="cx"> #endif
</span><del>- return WebCore::memoryCache().addImageToCache(image, url, topOrigin ? topOrigin->domainForCachePartition() : emptyString());
</del><ins>+ return WebCore::MemoryCache::singleton().addImageToCache(image, url, topOrigin ? topOrigin->domainForCachePartition() : emptyString());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> + (void)removeImageFromCacheForURL:(NSURL *)url
</span><span class="lines">@@ -193,7 +193,7 @@
</span><span class="cx"> if (frame)
</span><span class="cx"> topOrigin = core(frame)->document()->topOrigin();
</span><span class="cx"> #endif
</span><del>- WebCore::memoryCache().removeImageFromCache(url, topOrigin ? topOrigin->domainForCachePartition() : emptyString());
</del><ins>+ WebCore::MemoryCache::singleton().removeImageFromCache(url, topOrigin ? topOrigin->domainForCachePartition() : emptyString());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> + (CGImageRef)imageForURL:(NSURL *)url
</span><span class="lines">@@ -201,7 +201,7 @@
</span><span class="cx"> if (!url)
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- WebCore::CachedResource* cachedResource = WebCore::memoryCache().resourceForURL(url);
</del><ins>+ WebCore::CachedResource* cachedResource = WebCore::MemoryCache::singleton().resourceForURL(url);
</ins><span class="cx"> if (!is<WebCore::CachedImage>(cachedResource))
</span><span class="cx"> return nullptr;
</span><span class="cx"> WebCore::CachedImage& cachedImage = downcast<WebCore::CachedImage>(*cachedResource);
</span><span class="lines">@@ -217,12 +217,12 @@
</span><span class="cx"> if (!pthread_main_np())
</span><span class="cx"> return [[self _webkit_invokeOnMainThread] setDisabled:disabled];
</span><span class="cx">
</span><del>- WebCore::memoryCache().setDisabled(disabled);
</del><ins>+ WebCore::MemoryCache::singleton().setDisabled(disabled);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> + (BOOL)isDisabled
</span><span class="cx"> {
</span><del>- return WebCore::memoryCache().disabled();
</del><ins>+ return WebCore::MemoryCache::singleton().disabled();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -7913,8 +7913,9 @@
</span><span class="cx"> // Don't shrink a big disk cache, since that would cause churn.
</span><span class="cx"> nsurlCacheDiskCapacity = std::max(nsurlCacheDiskCapacity, [nsurlCache diskCapacity]);
</span><span class="cx">
</span><del>- memoryCache().setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
- memoryCache().setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
</del><ins>+ auto& memoryCache = MemoryCache::singleton();
+ memoryCache.setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
+ memoryCache.setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
</ins><span class="cx">
</span><span class="cx"> auto& pageCache = PageCache::singleton();
</span><span class="cx"> pageCache.setMaxSize(pageCacheSize);
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebKit/win/ChangeLog        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-02-02 Chris Dumez <cdumez@apple.com>
+
+ Access MemoryCache singleton using MemoryCache::singleton()
+ https://bugs.webkit.org/show_bug.cgi?id=141104
+
+ Reviewed by Andreas Kling.
+
+ Access MemoryCache singleton using MemoryCache::singleton() static
+ member function, instead of a free function, as per the recent
+ coding style discussion on WebKit-dev.
+
</ins><span class="cx"> 2015-01-30 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Rename shared() static member functions to singleton() for singleton classes.
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCache.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCache.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebKit/win/WebCache.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx"> if (!s)
</span><span class="cx"> return S_OK;
</span><span class="cx">
</span><del>- WebCore::MemoryCache::Statistics stat = WebCore::memoryCache().getStatistics();
</del><ins>+ WebCore::MemoryCache::Statistics stat = WebCore::MemoryCache::singleton().getStatistics();
</ins><span class="cx">
</span><span class="cx"> static CFStringRef imagesKey = CFSTR("images");
</span><span class="cx"> static CFStringRef stylesheetsKey = CFSTR("style sheets");
</span><span class="lines">@@ -206,10 +206,11 @@
</span><span class="cx">
</span><span class="cx"> HRESULT STDMETHODCALLTYPE WebCache::empty( void)
</span><span class="cx"> {
</span><del>- if (WebCore::memoryCache().disabled())
</del><ins>+ auto& memoryCache = WebCore::MemoryCache::singleton();
+ if (memoryCache.disabled())
</ins><span class="cx"> return S_OK;
</span><del>- WebCore::memoryCache().setDisabled(true);
- WebCore::memoryCache().setDisabled(false);
</del><ins>+ memoryCache.setDisabled(true);
+ memoryCache.setDisabled(false);
</ins><span class="cx">
</span><span class="cx"> // Empty the application cache.
</span><span class="cx"> WebCore::cacheStorage().empty();
</span><span class="lines">@@ -223,7 +224,7 @@
</span><span class="cx"> HRESULT STDMETHODCALLTYPE WebCache::setDisabled(
</span><span class="cx"> /* [in] */ BOOL disabled)
</span><span class="cx"> {
</span><del>- WebCore::memoryCache().setDisabled(!!disabled);
</del><ins>+ WebCore::MemoryCache::singleton().setDisabled(!!disabled);
</ins><span class="cx"> return S_OK;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -232,7 +233,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (!disabled)
</span><span class="cx"> return E_POINTER;
</span><del>- *disabled = WebCore::memoryCache().disabled();
</del><ins>+ *disabled = WebCore::MemoryCache::singleton().disabled();
</ins><span class="cx"> return S_OK;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebView.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebView.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebKit/win/WebView.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -673,8 +673,9 @@
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- memoryCache().setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
- memoryCache().setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
</del><ins>+ auto& memoryCache = MemoryCache::singleton();
+ memoryCache.setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
+ memoryCache.setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
</ins><span class="cx"> PageCache::singleton().setMaxSize(pageCacheSize);
</span><span class="cx">
</span><span class="cx"> #if USE(CFNETWORK)
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebKit2/ChangeLog        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2015-02-02 Chris Dumez <cdumez@apple.com>
+
+ Access MemoryCache singleton using MemoryCache::singleton()
+ https://bugs.webkit.org/show_bug.cgi?id=141104
+
+ Reviewed by Andreas Kling.
+
+ Access MemoryCache singleton using MemoryCache::singleton() static
+ member function, instead of a free function, as per the recent
+ coding style discussion on WebKit-dev.
+
</ins><span class="cx"> 2015-02-02 Jeremy Jones <jeremyj@apple.com>
</span><span class="cx">
</span><span class="cx"> Prevent crash when accessing WebAVPlayerController.delegate.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkNetworkProcessConnectioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebKit2/WebProcess/Network/NetworkProcessConnection.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx"> #if ENABLE(SHAREABLE_RESOURCE)
</span><span class="cx"> void NetworkProcessConnection::didCacheResource(const ResourceRequest& request, const ShareableResource::Handle& handle, SessionID sessionID)
</span><span class="cx"> {
</span><del>- CachedResource* resource = memoryCache().resourceForRequest(request, sessionID);
</del><ins>+ CachedResource* resource = MemoryCache::singleton().resourceForRequest(request, sessionID);
</ins><span class="cx"> if (!resource)
</span><span class="cx"> return;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessResourceCacheWebResourceCacheManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> #else
</span><span class="cx"> MemoryCache::SecurityOriginSet origins;
</span><span class="cx"> #endif
</span><del>- memoryCache().getOriginsWithCache(origins);
</del><ins>+ MemoryCache::singleton().getOriginsWithCache(origins);
</ins><span class="cx">
</span><span class="cx"> #if USE(CFURLCACHE)
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><span class="lines">@@ -114,7 +114,7 @@
</span><span class="cx"> if (!origin)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- memoryCache().removeResourcesWithOrigin(*origin);
</del><ins>+ MemoryCache::singleton().removeResourcesWithOrigin(*origin);
</ins><span class="cx">
</span><span class="cx"> #if USE(CFURLCACHE)
</span><span class="cx"> if (resourceCachesToClear != InMemoryResourceCachesOnly) {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -575,7 +575,7 @@
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx"> gcController().garbageCollectNow();
</span><span class="cx"> fontCache().invalidate();
</span><del>- memoryCache().setDisabled(true);
</del><ins>+ MemoryCache::singleton().setDisabled(true);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> m_webConnection->invalidate();
</span><span class="lines">@@ -633,7 +633,7 @@
</span><span class="cx">
</span><span class="cx"> gcController().garbageCollectSoon();
</span><span class="cx"> fontCache().invalidate();
</span><del>- memoryCache().setDisabled(true);
</del><ins>+ MemoryCache::singleton().setDisabled(true);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> // The UI process closed this connection, shut down.
</span><span class="lines">@@ -705,7 +705,7 @@
</span><span class="cx"> setCacheModel(CacheModelDocumentViewer);
</span><span class="cx"> setCacheModel(cacheModel);
</span><span class="cx">
</span><del>- memoryCache().evictResources();
</del><ins>+ MemoryCache::singleton().evictResources();
</ins><span class="cx">
</span><span class="cx"> // Empty the cross-origin preflight cache.
</span><span class="cx"> CrossOriginPreflightResultCache::singleton().empty();
</span><span class="lines">@@ -861,7 +861,7 @@
</span><span class="cx"> String xslString(ASCIILiteral("XSL"));
</span><span class="cx"> String javaScriptString(ASCIILiteral("JavaScript"));
</span><span class="cx">
</span><del>- MemoryCache::Statistics memoryCacheStatistics = memoryCache().getStatistics();
</del><ins>+ MemoryCache::Statistics memoryCacheStatistics = MemoryCache::singleton().getStatistics();
</ins><span class="cx">
</span><span class="cx"> HashMap<String, uint64_t> counts;
</span><span class="cx"> counts.set(imagesString, memoryCacheStatistics.images.count);
</span><span class="lines">@@ -1319,8 +1319,9 @@
</span><span class="cx">
</span><span class="cx"> void WebProcess::setMemoryCacheDisabled(bool disabled)
</span><span class="cx"> {
</span><del>- if (memoryCache().disabled() != disabled)
- memoryCache().setDisabled(disabled);
</del><ins>+ auto& memoryCache = MemoryCache::singleton();
+ if (memoryCache.disabled() != disabled)
+ memoryCache.setDisabled(disabled);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(SERVICE_CONTROLS)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcesscocoaWebProcessCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebProcessCocoa.mm        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -112,9 +112,9 @@
</span><span class="cx"> cacheTotalCapacity, cacheMinDeadCapacity, cacheMaxDeadCapacity, deadDecodedDataDeletionInterval,
</span><span class="cx"> pageCacheSize, urlCacheMemoryCapacity, urlCacheDiskCapacity);
</span><span class="cx">
</span><del>-
- memoryCache().setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
- memoryCache().setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
</del><ins>+ auto& memoryCache = MemoryCache::singleton();
+ memoryCache.setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
+ memoryCache.setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
</ins><span class="cx"> PageCache::singleton().setMaxSize(pageCacheSize);
</span><span class="cx">
</span><span class="cx"> NSURLCache *nsurlCache = [NSURLCache sharedURLCache];
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcesssoupWebProcessSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp (179488 => 179489)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp        2015-02-02 20:40:00 UTC (rev 179488)
+++ trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp        2015-02-02 20:50:16 UTC (rev 179489)
</span><span class="lines">@@ -101,9 +101,10 @@
</span><span class="cx"> cacheTotalCapacity, cacheMinDeadCapacity, cacheMaxDeadCapacity, deadDecodedDataDeletionInterval,
</span><span class="cx"> pageCacheSize, urlCacheMemoryCapacity, urlCacheDiskCapacity);
</span><span class="cx">
</span><del>- WebCore::memoryCache().setDisabled(cacheModel == CacheModelDocumentViewer);
- WebCore::memoryCache().setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
- WebCore::memoryCache().setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
</del><ins>+ auto& memoryCache = WebCore::MemoryCache::singleton();
+ memoryCache.setDisabled(cacheModel == CacheModelDocumentViewer);
+ memoryCache.setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
+ memoryCache.setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
</ins><span class="cx"> WebCore::PageCache::singleton().setMaxSize(pageCacheSize);
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(GTK)
</span></span></pre>
</div>
</div>
</body>
</html>