<!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  &lt;cdumez@apple.com&gt;
+
+        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  &lt;zalan@apple.com&gt;
</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-&gt;document()-&gt;topOrigin()-&gt;domainForCachePartition());
</span><span class="cx"> #endif
</span><del>-        cachedResource = memoryCache().resourceForRequest(request, frame-&gt;page()-&gt;sessionID());
</del><ins>+        cachedResource = MemoryCache::singleton().resourceForRequest(request, frame-&gt;page()-&gt;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-&gt;mainFrame()-&gt;document()-&gt;topOrigin()-&gt;domainForCachePartition());
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    CachedResource* cachedResource = memoryCache().resourceForRequest(request, m_pageAgent-&gt;page()-&gt;sessionID());
-    if (cachedResource)
-        memoryCache().remove(*cachedResource);
</del><ins>+    auto&amp; memoryCache = MemoryCache::singleton();
+    if (CachedResource* cachedResource = memoryCache.resourceForRequest(request, m_pageAgent-&gt;page()-&gt;sessionID()))
+        memoryCache.remove(*cachedResource);
</ins><span class="cx"> 
</span><span class="cx">     xhr-&gt;open(xhrReplayData-&gt;method(), xhrReplayData-&gt;url(), xhrReplayData-&gt;async(), IGNORE_EXCEPTION);
</span><span class="cx">     for (const auto&amp; header : xhrReplayData-&gt;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&amp; errorString, const String&amp; frameId, const String&amp; urlString, Ref&lt;LoadResourceCallback&gt;&amp;&amp; callback)
</span><span class="lines">@@ -788,7 +788,7 @@
</span><span class="cx"> void InspectorResourceAgent::mainFrameNavigated(DocumentLoader&amp; 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-&gt;clear(m_pageAgent-&gt;loaderId(&amp;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-&gt;frameLoader())
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        CachedResource* cachedResource = memoryCache().resourceForURL(handle-&gt;firstRequest().url(), loader-&gt;frameLoader()-&gt;frame().page()-&gt;sessionID());
</del><ins>+        CachedResource* cachedResource = MemoryCache::singleton().resourceForURL(handle-&gt;firstRequest().url(), loader-&gt;frameLoader()-&gt;frame().page()-&gt;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 &amp;&amp; m_frame-&gt;document()-&gt;hasManifest())
</span><del>-            memoryCache().remove(*m_mainResource);
</del><ins>+            MemoryCache::singleton().remove(*m_mainResource);
</ins><span class="cx">     }
</span><span class="cx">     m_applicationCacheHost-&gt;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 &lt; size; ++i) {
</span><del>-        CachedResource* resource = memoryCache().resourceForRequest(pastLoads[i], m_frame.page()-&gt;sessionID());
</del><ins>+        CachedResource* resource = MemoryCache::singleton().resourceForRequest(pastLoads[i], m_frame.page()-&gt;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() &amp;&amp; m_resource-&gt;resourceToRevalidate() &amp;&amp; newRequest.url() != m_resource-&gt;resourceToRevalidate()-&gt;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-&gt;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-&gt;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-&gt;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-&gt;mainFrame().diagnosticLoggingClient().logDiagnosticMessageWithResult(DiagnosticLoggingKeys::cachedResourceRevalidationKey(), emptyString(), DiagnosticLoggingResultFail);
</span><span class="cx">     }
</span><span class="lines">@@ -385,10 +385,10 @@
</span><span class="cx">     CachedResourceHandle&lt;CachedResource&gt; protectResource(m_resource);
</span><span class="cx">     m_state = Finishing;
</span><span class="cx">     if (m_resource-&gt;resourceToRevalidate())
</span><del>-        memoryCache().revalidationFailed(*m_resource);
</del><ins>+        MemoryCache::singleton().revalidationFailed(*m_resource);
</ins><span class="cx">     m_resource-&gt;setResourceError(error);
</span><span class="cx">     if (!m_resource-&gt;isPreloaded())
</span><del>-        memoryCache().remove(*m_resource);
</del><ins>+        MemoryCache::singleton().remove(*m_resource);
</ins><span class="cx">     m_resource-&gt;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&amp; memoryCache = MemoryCache::singleton();
</ins><span class="cx">     if (m_resource-&gt;resourceToRevalidate())
</span><del>-        memoryCache().revalidationFailed(*m_resource);
</del><ins>+        memoryCache.revalidationFailed(*m_resource);
</ins><span class="cx">     m_resource-&gt;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&amp;)
</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-&gt;document()-&gt;topOrigin()-&gt;domainForCachePartition());
</span><span class="cx"> #endif
</span><del>-                CachedResource* cachedResource = memoryCache().resourceForRequest(request, frame-&gt;page()-&gt;sessionID());
</del><ins>+                CachedResource* cachedResource = MemoryCache::singleton().resourceForRequest(request, frame-&gt;page()-&gt;sessionID());
</ins><span class="cx">                 if (cachedResource) {
</span><span class="cx">                     if (RefPtr&lt;ArchiveResource&gt; resource = ArchiveResource::create(cachedResource-&gt;resourceBuffer(), subresourceURL, cachedResource-&gt;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, (&quot;CachedResource&quot;));
</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, &quot;Cannot start loading '%s'&quot;, 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() &amp;&amp; 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) &amp;&amp; !m_response.isNull() &amp;&amp; !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 &amp;&amp; !hasClients()) {
</span><ins>+        auto&amp; 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">             // &quot;no-store: ... MUST make a best-effort attempt to remove the information from volatile storage as promptly as possible&quot;
</span><span class="cx">             // &quot;... History buffers MAY store such responses as part of their normal operation.&quot;
</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&amp; 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 &amp;&amp; !inLiveDecodedResourcesList &amp;&amp; hasClients())
</span><del>-            memoryCache().insertInLiveDecodedResourcesList(*this);
</del><ins>+            memoryCache.insertInLiveDecodedResourcesList(*this);
</ins><span class="cx">         else if (!m_decodedSize &amp;&amp; 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&amp; 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&amp; 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()-&gt;topOrigin()-&gt;domainForCachePartition());
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (CachedResource* existing = memoryCache().resourceForRequest(request.resourceRequest(), sessionID())) {
</del><ins>+    auto&amp; memoryCache = MemoryCache::singleton();
+    if (CachedResource* existing = memoryCache.resourceForRequest(request.resourceRequest(), sessionID())) {
</ins><span class="cx">         if (is&lt;CachedCSSStyleSheet&gt;(*existing))
</span><span class="cx">             return downcast&lt;CachedCSSStyleSheet&gt;(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&lt;CachedCSSStyleSheet&gt; 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-&gt;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&amp; 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-&gt;value-&gt;setOwningCachedResourceLoader(0);
</span><span class="lines">@@ -482,14 +484,14 @@
</span><span class="cx">         request.mutableResourceRequest().setDomainForCachePartition(document()-&gt;topOrigin()-&gt;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-&gt;errorOccurred()) {
</span><span class="cx">             if (resource-&gt;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-&gt;inCache());
</span><del>-    ASSERT(!memoryCache().disabled());
</del><ins>+    auto&amp; memoryCache = MemoryCache::singleton();
+    ASSERT(!memoryCache.disabled());
</ins><span class="cx">     ASSERT(resource-&gt;canUseCacheValidator());
</span><span class="cx">     ASSERT(!resource-&gt;resourceToRevalidate());
</span><span class="cx">     ASSERT(resource-&gt;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-&gt;url();
</del><span class="cx">     CachedResourceHandle&lt;CachedResource&gt; newResource = createResource(resource-&gt;type(), resource-&gt;resourceRequest(), resource-&gt;encoding(), resource-&gt;sessionID());
</span><span class="cx">     
</span><span class="cx">     LOG(ResourceLoading, &quot;Resource %p created to revalidate %p&quot;, newResource.get(), resource);
</span><span class="cx">     newResource-&gt;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&lt;CachedResource&gt; CachedResourceLoader::loadResource(CachedResource::Type type, CachedResourceRequest&amp; request)
</span><span class="cx"> {
</span><del>-    ASSERT(!memoryCache().resourceForRequest(request.resourceRequest(), sessionID()));
</del><ins>+    auto&amp; memoryCache = MemoryCache::singleton();
+    ASSERT(!memoryCache.resourceForRequest(request.resourceRequest(), sessionID()));
</ins><span class="cx"> 
</span><span class="cx">     LOG(ResourceLoading, &quot;Loading CachedResource for '%s'.&quot;, request.resourceRequest().url().stringCenterEllipsizedToLength().latin1().data());
</span><span class="cx"> 
</span><span class="cx">     CachedResourceHandle&lt;CachedResource&gt; 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-&gt;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(), &amp;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-&gt;decreasePreloadCount();
</span><span class="cx">         bool deleted = resource-&gt;deleteIfPossible();
</span><span class="cx">         if (!deleted &amp;&amp; resource-&gt;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-&gt;errorOccurred())
</span><del>-            memoryCache().remove(res);
</del><ins>+            MemoryCache::singleton().remove(res);
</ins><span class="cx">         
</span><span class="cx">         res-&gt;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&amp; memoryCache()
</del><ins>+MemoryCache&amp; MemoryCache::singleton()
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(WTF::isMainThread());
</span><del>-
</del><span class="cx">     static NeverDestroyed&lt;MemoryCache&gt; 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&amp; resources : memoryCache().m_sessionResources) {
-        if (CachedResource* resource = memoryCache().resourceForRequestImpl(request, *resources.value))
-            memoryCache().remove(*resource);
</del><ins>+    auto&amp; memoryCache = MemoryCache::singleton();
+    for (auto&amp; 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&lt;MemoryCache&gt;;
</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&amp; singleton();
+
</ins><span class="cx">     WEBCORE_EXPORT CachedResource* resourceForURL(const URL&amp;, SessionID = SessionID::defaultSessionID());
</span><span class="cx">     WEBCORE_EXPORT CachedResource* resourceForRequest(const ResourceRequest&amp;, 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&amp; 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&amp; 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 &amp;&amp; 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(&quot;Prune MemoryCache&quot;);
</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()-&gt;page())
</span><span class="cx">         return false;
</span><del>-    CachedResource* resource = memoryCache().resourceForURL(contextDocument()-&gt;completeURL(url), contextDocument()-&gt;page()-&gt;sessionID());
</del><ins>+    CachedResource* resource = MemoryCache::singleton().resourceForURL(contextDocument()-&gt;completeURL(url), contextDocument()-&gt;page()-&gt;sessionID());
</ins><span class="cx">     return resource &amp;&amp; resource-&gt;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&amp; 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  &lt;cdumez@apple.com&gt;
+
+        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  &lt;cdumez@apple.com&gt;
</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)-&gt;document()-&gt;topOrigin();
</span><span class="cx"> #endif
</span><del>-    return WebCore::memoryCache().addImageToCache(image, url, topOrigin ? topOrigin-&gt;domainForCachePartition() : emptyString());
</del><ins>+    return WebCore::MemoryCache::singleton().addImageToCache(image, url, topOrigin ? topOrigin-&gt;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)-&gt;document()-&gt;topOrigin();
</span><span class="cx"> #endif
</span><del>-    WebCore::memoryCache().removeImageFromCache(url, topOrigin ? topOrigin-&gt;domainForCachePartition() : emptyString());
</del><ins>+    WebCore::MemoryCache::singleton().removeImageFromCache(url, topOrigin ? topOrigin-&gt;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&lt;WebCore::CachedImage&gt;(cachedResource))
</span><span class="cx">         return nullptr;
</span><span class="cx">     WebCore::CachedImage&amp; cachedImage = downcast&lt;WebCore::CachedImage&gt;(*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&amp; memoryCache = MemoryCache::singleton();
+    memoryCache.setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
+    memoryCache.setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
</ins><span class="cx"> 
</span><span class="cx">     auto&amp; 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  &lt;cdumez@apple.com&gt;
+
+        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  &lt;cdumez@apple.com&gt;
</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(&quot;images&quot;);
</span><span class="cx">     static CFStringRef stylesheetsKey = CFSTR(&quot;style sheets&quot;);
</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&amp; 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&amp; 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  &lt;cdumez@apple.com&gt;
+
+        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  &lt;jeremyj@apple.com&gt;
</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&amp; request, const ShareableResource::Handle&amp; 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-&gt;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(&quot;XSL&quot;));
</span><span class="cx">     String javaScriptString(ASCIILiteral(&quot;JavaScript&quot;));
</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&lt;String, uint64_t&gt; 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&amp; 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&amp; 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&amp; 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>