<!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>[179421] 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/179421">179421</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-01-30 16:04:36 -0800 (Fri, 30 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Update MemoryCache code to use more references instead of pointers
https://bugs.webkit.org/show_bug.cgi?id=141099

Reviewed by Andreas Kling.
Source/WebKit2:

* WebProcess/ResourceCache/WebResourceCacheManager.cpp:
(WebKit::WebResourceCacheManager::clearCacheForOrigin):</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="#trunkSourceWebCorehtmlDOMURLcpp">trunk/Source/WebCore/html/DOMURL.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="#trunkSourceWebCoreloaderSubresourceLoadercpp">trunk/Source/WebCore/loader/SubresourceLoader.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="#trunkSourceWebCoreloadercacheCachedResourceHandleh">trunk/Source/WebCore/loader/cache/CachedResourceHandle.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceLoadercpp">trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedResourceLoaderh">trunk/Source/WebCore/loader/cache/CachedResourceLoader.h</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="#trunkSourceWebCoreplatformgraphicsMaskImageOperationcpp">trunk/Source/WebCore/platform/graphics/MaskImageOperation.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessResourceCacheWebResourceCacheManagercpp">trunk/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (179420 => 179421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-30 23:58:20 UTC (rev 179420)
+++ trunk/Source/WebCore/ChangeLog        2015-01-31 00:04:36 UTC (rev 179421)
</span><span class="lines">@@ -1,3 +1,10 @@
</span><ins>+2015-01-30  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Update MemoryCache code to use more references instead of pointers
+        https://bugs.webkit.org/show_bug.cgi?id=141099
+
+        Reviewed by Andreas Kling.
+
</ins><span class="cx"> 2015-01-30  Brian J. Burg  &lt;burg@cs.washington.edu&gt;
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: ASSERT in InspectorTimelineAgent::internalStop
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (179420 => 179421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2015-01-30 23:58:20 UTC (rev 179420)
+++ trunk/Source/WebCore/WebCore.exp.in        2015-01-31 00:04:36 UTC (rev 179421)
</span><span class="lines">@@ -196,7 +196,7 @@
</span><span class="cx"> __ZN7WebCore11MemoryCache18resourceForRequestERKNS_15ResourceRequestENS_9SessionIDE
</span><span class="cx"> __ZN7WebCore11MemoryCache19getOriginsWithCacheERN3WTF7HashSetINS1_6RefPtrINS_14SecurityOriginEEENS_18SecurityOriginHashENS1_10HashTraitsIS5_EEEE
</span><span class="cx"> __ZN7WebCore11MemoryCache20removeImageFromCacheERKNS_3URLERKN3WTF6StringE
</span><del>-__ZN7WebCore11MemoryCache25removeResourcesWithOriginEPNS_14SecurityOriginE
</del><ins>+__ZN7WebCore11MemoryCache25removeResourcesWithOriginERNS_14SecurityOriginE
</ins><span class="cx"> __ZN7WebCore11PageOverlay15setNeedsDisplayERKNS_7IntRectE
</span><span class="cx"> __ZN7WebCore11PageOverlay15setNeedsDisplayEv
</span><span class="cx"> __ZN7WebCore11PageOverlay20stopFadeOutAnimationEv
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlDOMURLcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/DOMURL.cpp (179420 => 179421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/DOMURL.cpp        2015-01-30 23:58:20 UTC (rev 179420)
+++ trunk/Source/WebCore/html/DOMURL.cpp        2015-01-31 00:04:36 UTC (rev 179421)
</span><span class="lines">@@ -118,7 +118,7 @@
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><span class="cx">     request.setDomainForCachePartition(scriptExecutionContext-&gt;topOrigin()-&gt;domainForCachePartition());
</span><span class="cx"> #endif
</span><del>-    MemoryCache::removeRequestFromSessionCaches(scriptExecutionContext, request);
</del><ins>+    MemoryCache::removeRequestFromSessionCaches(*scriptExecutionContext, request);
</ins><span class="cx"> 
</span><span class="cx">     scriptExecutionContext-&gt;publicURLManager().revoke(url);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorResourceAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp (179420 => 179421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp        2015-01-30 23:58:20 UTC (rev 179420)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp        2015-01-31 00:04:36 UTC (rev 179421)
</span><span class="lines">@@ -710,7 +710,7 @@
</span><span class="cx"> 
</span><span class="cx">     CachedResource* cachedResource = memoryCache().resourceForRequest(request, m_pageAgent-&gt;page()-&gt;sessionID());
</span><span class="cx">     if (cachedResource)
</span><del>-        memoryCache().remove(cachedResource);
</del><ins>+        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></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (179420 => 179421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.cpp        2015-01-30 23:58:20 UTC (rev 179420)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp        2015-01-31 00:04:36 UTC (rev 179421)
</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.get());
</del><ins>+            memoryCache().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.get());
</del><ins>+        memoryCache().remove(*m_mainResource);
</ins><span class="cx"> 
</span><span class="cx">     if (willLoadFallback)
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderSubresourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/SubresourceLoader.cpp (179420 => 179421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/SubresourceLoader.cpp        2015-01-30 23:58:20 UTC (rev 179420)
+++ trunk/Source/WebCore/loader/SubresourceLoader.cpp        2015-01-31 00:04:36 UTC (rev 179421)
</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().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().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().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().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().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">@@ -418,9 +418,9 @@
</span><span class="cx">     m_state = Finishing;
</span><span class="cx"> #endif
</span><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="trunkSourceWebCoreloadercacheCachedImagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedImage.cpp (179420 => 179421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedImage.cpp        2015-01-30 23:58:20 UTC (rev 179420)
+++ trunk/Source/WebCore/loader/cache/CachedImage.cpp        2015-01-31 00:04:36 UTC (rev 179421)
</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().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().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 (179420 => 179421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResource.cpp        2015-01-30 23:58:20 UTC (rev 179420)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp        2015-01-31 00:04:36 UTC (rev 179421)
</span><span class="lines">@@ -170,7 +170,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     if (m_owningCachedResourceLoader)
</span><del>-        m_owningCachedResourceLoader-&gt;removeCachedResource(this);
</del><ins>+        m_owningCachedResourceLoader-&gt;removeCachedResource(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CachedResource::failBeforeStarting()
</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().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().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">@@ -447,8 +447,8 @@
</span><span class="cx">     bool deleted = deleteIfPossible();
</span><span class="cx">     if (!deleted &amp;&amp; !hasClients()) {
</span><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,7 +458,7 @@
</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><span class="cx">         memoryCache().prune();
</span><span class="cx">     }
</span><span class="lines">@@ -499,13 +499,13 @@
</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().removeFromLRUList(*this);
</ins><span class="cx">     
</span><span class="cx">     m_decodedSize = size;
</span><span class="cx">    
</span><span class="cx">     if (inCache()) { 
</span><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">@@ -516,9 +516,9 @@
</span><span class="cx">         // a problem. For more details please see: https://bugs.webkit.org/show_bug.cgi?id=30209
</span><span class="cx">         bool inLiveDecodedResourcesList = memoryCache().inLiveDecodedResourcesList(*this);
</span><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><span class="cx">         memoryCache().adjustSize(hasClients(), delta);
</span><span class="lines">@@ -535,12 +535,12 @@
</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().removeFromLRUList(*this);
</ins><span class="cx"> 
</span><span class="cx">     m_encodedSize = size;
</span><span class="cx"> 
</span><span class="cx">     if (inCache()) { 
</span><del>-        memoryCache().insertInLRUList(this);
</del><ins>+        memoryCache().insertInLRUList(*this);
</ins><span class="cx">         memoryCache().adjustSize(hasClients(), delta);
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -551,8 +551,8 @@
</span><span class="cx">     
</span><span class="cx">     if (inCache()) {
</span><span class="cx">         if (memoryCache().inLiveDecodedResourcesList(*this)) {
</span><del>-            memoryCache().removeFromLiveDecodedResourcesList(this);
-            memoryCache().insertInLiveDecodedResourcesList(this);
</del><ins>+            memoryCache().removeFromLiveDecodedResourcesList(*this);
+            memoryCache().insertInLiveDecodedResourcesList(*this);
</ins><span class="cx">         }
</span><span class="cx">         memoryCache().prune();
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceHandleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceHandle.h (179420 => 179421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceHandle.h        2015-01-30 23:58:20 UTC (rev 179420)
+++ trunk/Source/WebCore/loader/cache/CachedResourceHandle.h        2015-01-31 00:04:36 UTC (rev 179421)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx"> 
</span><span class="cx">     R* get() const { return reinterpret_cast&lt;R*&gt;(CachedResourceHandleBase::get()); }
</span><span class="cx">     R* operator-&gt;() const { return get(); }
</span><ins>+    R&amp; operator*() const { ASSERT(get()); return *get(); }
</ins><span class="cx"> 
</span><span class="cx">     CachedResourceHandle&amp; operator=(R* res) { setResource(res); return *this; } 
</span><span class="cx">     CachedResourceHandle&amp; operator=(const CachedResourceHandle&amp; o) { setResource(o.get()); return *this; }
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp (179420 => 179421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2015-01-30 23:58:20 UTC (rev 179420)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.cpp        2015-01-31 00:04:36 UTC (rev 179421)
</span><span class="lines">@@ -218,14 +218,14 @@
</span><span class="cx">     if (CachedResource* existing = memoryCache().resourceForRequest(request.resourceRequest(), sessionID())) {
</span><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.get());
</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">@@ -489,7 +489,7 @@
</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.get());
</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 +505,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.get());
</del><ins>+        memoryCache().resourceAccessed(*resource);
</ins><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -521,7 +521,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.get());
</del><ins>+                memoryCache().remove(*resource);
</ins><span class="cx">             return nullptr;
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -555,8 +555,8 @@
</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.get());
</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">@@ -573,7 +573,7 @@
</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.get()))
</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">@@ -789,22 +789,22 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CachedResourceLoader::removeCachedResource(CachedResource* resource) const
</del><ins>+void CachedResourceLoader::removeCachedResource(CachedResource&amp; resource)
</ins><span class="cx"> {
</span><span class="cx"> #ifndef NDEBUG
</span><del>-    DocumentResourceMap::iterator it = m_documentResources.find(resource-&gt;url());
</del><ins>+    DocumentResourceMap::iterator it = m_documentResources.find(resource.url());
</ins><span class="cx">     if (it != m_documentResources.end())
</span><del>-        ASSERT(it-&gt;value.get() == resource);
</del><ins>+        ASSERT(it-&gt;value.get() == &amp;resource);
</ins><span class="cx"> #endif
</span><del>-    m_documentResources.remove(resource-&gt;url());
</del><ins>+    m_documentResources.remove(resource.url());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CachedResourceLoader::addCachedResource(CachedResource* resource)
</del><ins>+void CachedResourceLoader::addCachedResource(CachedResource&amp; resource)
</ins><span class="cx"> {
</span><del>-    m_documentResources.set(resource-&gt;url(), resource);
</del><ins>+    m_documentResources.set(resource.url(), &amp;resource);
</ins><span class="cx"> 
</span><span class="cx">     if (!memoryCache().add(resource))
</span><del>-        resource-&gt;setOwningCachedResourceLoader(this);
</del><ins>+        resource.setOwningCachedResourceLoader(this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void CachedResourceLoader::loadDone(CachedResource* resource, bool shouldPerformPostLoadActions)
</span><span class="lines">@@ -985,13 +985,11 @@
</span><span class="cx">     if (!m_preloads)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    ListHashSet&lt;CachedResource*&gt;::iterator end = m_preloads-&gt;end();
-    for (ListHashSet&lt;CachedResource*&gt;::iterator it = m_preloads-&gt;begin(); it != end; ++it) {
-        CachedResource* res = *it;
-        res-&gt;decreasePreloadCount();
-        bool deleted = res-&gt;deleteIfPossible();
-        if (!deleted &amp;&amp; res-&gt;preloadResult() == CachedResource::PreloadNotReferenced)
-            memoryCache().remove(res);
</del><ins>+    for (auto* resource : *m_preloads) {
+        resource-&gt;decreasePreloadCount();
+        bool deleted = resource-&gt;deleteIfPossible();
+        if (!deleted &amp;&amp; resource-&gt;preloadResult() == CachedResource::PreloadNotReferenced)
+            memoryCache().remove(*resource);
</ins><span class="cx">     }
</span><span class="cx">     m_preloads = nullptr;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedResourceLoader.h (179420 => 179421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedResourceLoader.h        2015-01-30 23:58:20 UTC (rev 179420)
+++ trunk/Source/WebCore/loader/cache/CachedResourceLoader.h        2015-01-31 00:04:36 UTC (rev 179421)
</span><span class="lines">@@ -113,8 +113,8 @@
</span><span class="cx">     void clearDocumentLoader() { m_documentLoader = 0; }
</span><span class="cx">     SessionID sessionID() const;
</span><span class="cx"> 
</span><del>-    void removeCachedResource(CachedResource*) const;
-    void addCachedResource(CachedResource*);
</del><ins>+    void removeCachedResource(CachedResource&amp;);
+    void addCachedResource(CachedResource&amp;);
</ins><span class="cx"> 
</span><span class="cx">     void loadDone(CachedResource*, bool shouldPerformPostLoadActions = true);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheMemoryCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/MemoryCache.cpp (179420 => 179421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/MemoryCache.cpp        2015-01-30 23:58:20 UTC (rev 179420)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.cpp        2015-01-31 00:04:36 UTC (rev 179421)
</span><span class="lines">@@ -99,81 +99,82 @@
</span><span class="cx">     return url;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool MemoryCache::add(CachedResource* resource)
</del><ins>+bool MemoryCache::add(CachedResource&amp; resource)
</ins><span class="cx"> {
</span><span class="cx">     if (disabled())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     ASSERT(WTF::isMainThread());
</span><span class="cx"> 
</span><del>-    CachedResourceMap&amp; resources = getSessionMap(resource-&gt;sessionID());
</del><ins>+    CachedResourceMap&amp; resources = getSessionMap(resource.sessionID());
</ins><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><del>-    CachedResourceItem* originMap = resources.get(resource-&gt;url());
</del><ins>+    CachedResourceItem* originMap = resources.get(resource.url());
</ins><span class="cx">     if (!originMap) {
</span><span class="cx">         originMap = new CachedResourceItem;
</span><del>-        resources.set(resource-&gt;url(), adoptPtr(originMap));
</del><ins>+        resources.set(resource.url(), adoptPtr(originMap));
</ins><span class="cx">     }
</span><del>-    originMap-&gt;set(resource-&gt;cachePartition(), resource);
</del><ins>+    originMap-&gt;set(resource.cachePartition(), &amp;resource);
</ins><span class="cx"> #else
</span><del>-    resources.set(resource-&gt;url(), resource);
</del><ins>+    resources.set(resource.url(), &amp;resource);
</ins><span class="cx"> #endif
</span><del>-    resource-&gt;setInCache(true);
</del><ins>+    resource.setInCache(true);
</ins><span class="cx">     
</span><span class="cx">     resourceAccessed(resource);
</span><span class="cx">     
</span><del>-    LOG(ResourceLoading, &quot;MemoryCache::add Added '%s', resource %p\n&quot;, resource-&gt;url().string().latin1().data(), resource);
</del><ins>+    LOG(ResourceLoading, &quot;MemoryCache::add Added '%s', resource %p\n&quot;, resource.url().string().latin1().data(), &amp;resource);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MemoryCache::revalidationSucceeded(CachedResource* revalidatingResource, const ResourceResponse&amp; response)
</del><ins>+// FIXME: This should take a reference.
+void MemoryCache::revalidationSucceeded(CachedResource&amp; revalidatingResource, const ResourceResponse&amp; response)
</ins><span class="cx"> {
</span><del>-    CachedResource* resource = revalidatingResource-&gt;resourceToRevalidate();
-    ASSERT(resource);
-    ASSERT(!resource-&gt;inCache());
-    ASSERT(resource-&gt;isLoaded());
-    ASSERT(revalidatingResource-&gt;inCache());
</del><ins>+    ASSERT(revalidatingResource.resourceToRevalidate());
+    CachedResource&amp; resource = *revalidatingResource.resourceToRevalidate();
+    ASSERT(!resource.inCache());
+    ASSERT(resource.isLoaded());
+    ASSERT(revalidatingResource.inCache());
</ins><span class="cx"> 
</span><span class="cx">     // Calling remove() can potentially delete revalidatingResource, which we use
</span><span class="cx">     // below. This mustn't be the case since revalidation means it is loaded
</span><span class="cx">     // and so canDelete() is false.
</span><del>-    ASSERT(!revalidatingResource-&gt;canDelete());
</del><ins>+    ASSERT(!revalidatingResource.canDelete());
</ins><span class="cx"> 
</span><span class="cx">     remove(revalidatingResource);
</span><span class="cx"> 
</span><del>-    CachedResourceMap&amp; resources = getSessionMap(resource-&gt;sessionID());
</del><ins>+    CachedResourceMap&amp; resources = getSessionMap(resource.sessionID());
</ins><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><del>-    ASSERT(!resources.get(resource-&gt;url()) || !resources.get(resource-&gt;url())-&gt;get(resource-&gt;cachePartition()));
-    CachedResourceItem* originMap = resources.get(resource-&gt;url());
</del><ins>+    ASSERT(!resources.get(resource.url()) || !resources.get(resource.url())-&gt;get(resource.cachePartition()));
+    CachedResourceItem* originMap = resources.get(resource.url());
</ins><span class="cx">     if (!originMap) {
</span><span class="cx">         originMap = new CachedResourceItem;
</span><del>-        resources.set(resource-&gt;url(), adoptPtr(originMap));
</del><ins>+        resources.set(resource.url(), adoptPtr(originMap));
</ins><span class="cx">     }
</span><del>-    originMap-&gt;set(resource-&gt;cachePartition(), resource);
</del><ins>+    originMap-&gt;set(resource.cachePartition(), &amp;resource);
</ins><span class="cx"> #else
</span><del>-    ASSERT(!resources.get(resource-&gt;url()));
-    resources.set(resource-&gt;url(), resource);
</del><ins>+    ASSERT(!resources.get(resource.url()));
+    resources.set(resource.url(), &amp;resource);
</ins><span class="cx"> #endif
</span><del>-    resource-&gt;setInCache(true);
-    resource-&gt;updateResponseAfterRevalidation(response);
</del><ins>+    resource.setInCache(true);
+    resource.updateResponseAfterRevalidation(response);
</ins><span class="cx">     insertInLRUList(resource);
</span><del>-    int delta = resource-&gt;size();
-    if (resource-&gt;decodedSize() &amp;&amp; resource-&gt;hasClients())
</del><ins>+    int delta = resource.size();
+    if (resource.decodedSize() &amp;&amp; resource.hasClients())
</ins><span class="cx">         insertInLiveDecodedResourcesList(resource);
</span><span class="cx">     if (delta)
</span><del>-        adjustSize(resource-&gt;hasClients(), delta);
</del><ins>+        adjustSize(resource.hasClients(), delta);
</ins><span class="cx">     
</span><del>-    revalidatingResource-&gt;switchClientsToRevalidatedResource();
-    ASSERT(!revalidatingResource-&gt;m_deleted);
</del><ins>+    revalidatingResource.switchClientsToRevalidatedResource();
+    ASSERT(!revalidatingResource.m_deleted);
</ins><span class="cx">     // this deletes the revalidating resource
</span><del>-    revalidatingResource-&gt;clearResourceToRevalidate();
</del><ins>+    revalidatingResource.clearResourceToRevalidate();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MemoryCache::revalidationFailed(CachedResource* revalidatingResource)
</del><ins>+void MemoryCache::revalidationFailed(CachedResource&amp; revalidatingResource)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(WTF::isMainThread());
</span><del>-    LOG(ResourceLoading, &quot;Revalidation failed for %p&quot;, revalidatingResource);
-    ASSERT(revalidatingResource-&gt;resourceToRevalidate());
-    revalidatingResource-&gt;clearResourceToRevalidate();
</del><ins>+    LOG(ResourceLoading, &quot;Revalidation failed for %p&quot;, &amp;revalidatingResource);
+    ASSERT(revalidatingResource.resourceToRevalidate());
+    revalidatingResource.clearResourceToRevalidate();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> CachedResource* MemoryCache::resourceForURL(const URL&amp; resourceURL, SessionID sessionID)
</span><span class="lines">@@ -193,7 +194,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><span class="cx">     CachedResourceItem* item = resources.get(url);
</span><del>-    CachedResource* resource = 0;
</del><ins>+    CachedResource* resource = nullptr;
</ins><span class="cx">     if (item)
</span><span class="cx">         resource = item-&gt;get(request.cachePartition());
</span><span class="cx"> #else
</span><span class="lines">@@ -245,7 +246,7 @@
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><span class="cx">     cachedImage-&gt;resourceRequest().setDomainForCachePartition(domainForCachePartition);
</span><span class="cx"> #endif
</span><del>-    return add(cachedImage.release());
</del><ins>+    return add(*cachedImage.release());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MemoryCache::removeImageFromCache(const URL&amp; url, const String&amp; domainForCachePartition)
</span><span class="lines">@@ -266,7 +267,7 @@
</span><span class="cx"> 
</span><span class="cx">     // A resource exists and is not a manually cached image, so just remove it.
</span><span class="cx">     if (!is&lt;CachedImage&gt;(*resource) || !downcast&lt;CachedImage&gt;(*resource).isManuallyCached()) {
</span><del>-        remove(resource);
</del><ins>+        remove(*resource);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -383,7 +384,7 @@
</span><span class="cx">             CachedResourceHandle&lt;CachedResource&gt; previous = current-&gt;m_prevInAllResourcesList;
</span><span class="cx">             ASSERT(!previous || previous-&gt;inCache());
</span><span class="cx">             if (!current-&gt;hasClients() &amp;&amp; !current-&gt;isPreloaded() &amp;&amp; !current-&gt;isCacheValidator()) {
</span><del>-                remove(current);
</del><ins>+                remove(*current);
</ins><span class="cx">                 if (targetSize &amp;&amp; m_deadSize &lt;= targetSize)
</span><span class="cx">                     return;
</span><span class="cx">             }
</span><span class="lines">@@ -411,73 +412,73 @@
</span><span class="cx">     prune();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MemoryCache::remove(CachedResource* resource)
</del><ins>+void MemoryCache::remove(CachedResource&amp; resource)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(WTF::isMainThread());
</span><del>-    LOG(ResourceLoading, &quot;Evicting resource %p for '%s' from cache&quot;, resource, resource-&gt;url().string().latin1().data());
</del><ins>+    LOG(ResourceLoading, &quot;Evicting resource %p for '%s' from cache&quot;, &amp;resource, resource.url().string().latin1().data());
</ins><span class="cx">     // The resource may have already been removed by someone other than our caller,
</span><span class="cx">     // who needed a fresh copy for a reload. See &lt;http://bugs.webkit.org/show_bug.cgi?id=12479#c6&gt;.
</span><del>-    CachedResourceMap&amp; resources = getSessionMap(resource-&gt;sessionID());
-    if (resource-&gt;inCache()) {
</del><ins>+    CachedResourceMap&amp; resources = getSessionMap(resource.sessionID());
+    if (resource.inCache()) {
</ins><span class="cx">         // Remove from the resource map.
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><del>-        CachedResourceItem* item = resources.get(resource-&gt;url());
</del><ins>+        CachedResourceItem* item = resources.get(resource.url());
</ins><span class="cx">         if (item) {
</span><del>-            item-&gt;remove(resource-&gt;cachePartition());
</del><ins>+            item-&gt;remove(resource.cachePartition());
</ins><span class="cx">             if (!item-&gt;size())
</span><del>-                resources.remove(resource-&gt;url());
</del><ins>+                resources.remove(resource.url());
</ins><span class="cx">         }
</span><span class="cx"> #else
</span><del>-        resources.remove(resource-&gt;url());
</del><ins>+        resources.remove(resource.url());
</ins><span class="cx"> #endif
</span><del>-        resource-&gt;setInCache(false);
</del><ins>+        resource.setInCache(false);
</ins><span class="cx"> 
</span><span class="cx">         // Remove from the appropriate LRU list.
</span><span class="cx">         removeFromLRUList(resource);
</span><span class="cx">         removeFromLiveDecodedResourcesList(resource);
</span><del>-        adjustSize(resource-&gt;hasClients(), -static_cast&lt;int&gt;(resource-&gt;size()));
</del><ins>+        adjustSize(resource.hasClients(), -static_cast&lt;int&gt;(resource.size()));
</ins><span class="cx">     } else
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><del>-        ASSERT(!resources.get(resource-&gt;url()) || resources.get(resource-&gt;url())-&gt;get(resource-&gt;cachePartition()) != resource);
</del><ins>+        ASSERT(!resources.get(resource.url()) || resources.get(resource.url())-&gt;get(resource.cachePartition()) != &amp;resource);
</ins><span class="cx"> #else
</span><del>-        ASSERT(resources.get(resource-&gt;url()) != resource);
</del><ins>+        ASSERT(resources.get(resource.url()) != &amp;resource);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    resource-&gt;deleteIfPossible();
</del><ins>+    resource.deleteIfPossible();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-MemoryCache::LRUList* MemoryCache::lruListFor(CachedResource* resource)
</del><ins>+MemoryCache::LRUList* MemoryCache::lruListFor(CachedResource&amp; resource)
</ins><span class="cx"> {
</span><del>-    unsigned accessCount = std::max(resource-&gt;accessCount(), 1U);
-    unsigned queueIndex = WTF::fastLog2(resource-&gt;size() / accessCount);
</del><ins>+    unsigned accessCount = std::max(resource.accessCount(), 1U);
+    unsigned queueIndex = WTF::fastLog2(resource.size() / accessCount);
</ins><span class="cx"> #ifndef NDEBUG
</span><del>-    resource-&gt;m_lruIndex = queueIndex;
</del><ins>+    resource.m_lruIndex = queueIndex;
</ins><span class="cx"> #endif
</span><span class="cx">     if (m_allResources.size() &lt;= queueIndex)
</span><span class="cx">         m_allResources.grow(queueIndex + 1);
</span><span class="cx">     return &amp;m_allResources[queueIndex];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MemoryCache::removeFromLRUList(CachedResource* resource)
</del><ins>+void MemoryCache::removeFromLRUList(CachedResource&amp; resource)
</ins><span class="cx"> {
</span><span class="cx">     // If we've never been accessed, then we're brand new and not in any list.
</span><del>-    if (resource-&gt;accessCount() == 0)
</del><ins>+    if (!resource.accessCount())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx"> #if !ASSERT_DISABLED
</span><del>-    unsigned oldListIndex = resource-&gt;m_lruIndex;
</del><ins>+    unsigned oldListIndex = resource.m_lruIndex;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     LRUList* list = lruListFor(resource);
</span><span class="cx"> 
</span><span class="cx"> #if !ASSERT_DISABLED
</span><span class="cx">     // Verify that the list we got is the list we want.
</span><del>-    ASSERT(resource-&gt;m_lruIndex == oldListIndex);
</del><ins>+    ASSERT(resource.m_lruIndex == oldListIndex);
</ins><span class="cx"> 
</span><span class="cx">     // Verify that we are in fact in this list.
</span><span class="cx">     bool found = false;
</span><span class="cx">     for (CachedResource* current = list-&gt;m_head; current; current = current-&gt;m_nextInAllResourcesList) {
</span><del>-        if (current == resource) {
</del><ins>+        if (current == &amp;resource) {
</ins><span class="cx">             found = true;
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="lines">@@ -485,49 +486,49 @@
</span><span class="cx">     ASSERT(found);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    CachedResource* next = resource-&gt;m_nextInAllResourcesList;
-    CachedResource* prev = resource-&gt;m_prevInAllResourcesList;
</del><ins>+    CachedResource* next = resource.m_nextInAllResourcesList;
+    CachedResource* prev = resource.m_prevInAllResourcesList;
</ins><span class="cx">     
</span><del>-    if (next == 0 &amp;&amp; prev == 0 &amp;&amp; list-&gt;m_head != resource)
</del><ins>+    if (!next &amp;&amp; !prev &amp;&amp; list-&gt;m_head != &amp;resource)
</ins><span class="cx">         return;
</span><span class="cx">     
</span><del>-    resource-&gt;m_nextInAllResourcesList = 0;
-    resource-&gt;m_prevInAllResourcesList = 0;
</del><ins>+    resource.m_nextInAllResourcesList = nullptr;
+    resource.m_prevInAllResourcesList = nullptr;
</ins><span class="cx">     
</span><span class="cx">     if (next)
</span><span class="cx">         next-&gt;m_prevInAllResourcesList = prev;
</span><del>-    else if (list-&gt;m_tail == resource)
</del><ins>+    else if (list-&gt;m_tail == &amp;resource)
</ins><span class="cx">         list-&gt;m_tail = prev;
</span><span class="cx"> 
</span><span class="cx">     if (prev)
</span><span class="cx">         prev-&gt;m_nextInAllResourcesList = next;
</span><del>-    else if (list-&gt;m_head == resource)
</del><ins>+    else if (list-&gt;m_head == &amp;resource)
</ins><span class="cx">         list-&gt;m_head = next;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MemoryCache::insertInLRUList(CachedResource* resource)
</del><ins>+void MemoryCache::insertInLRUList(CachedResource&amp; resource)
</ins><span class="cx"> {
</span><span class="cx">     // Make sure we aren't in some list already.
</span><del>-    ASSERT(!resource-&gt;m_nextInAllResourcesList &amp;&amp; !resource-&gt;m_prevInAllResourcesList);
-    ASSERT(resource-&gt;inCache());
-    ASSERT(resource-&gt;accessCount() &gt; 0);
</del><ins>+    ASSERT(!resource.m_nextInAllResourcesList &amp;&amp; !resource.m_prevInAllResourcesList);
+    ASSERT(resource.inCache());
+    ASSERT(resource.accessCount() &gt; 0);
</ins><span class="cx">     
</span><span class="cx">     LRUList* list = lruListFor(resource);
</span><span class="cx"> 
</span><del>-    resource-&gt;m_nextInAllResourcesList = list-&gt;m_head;
</del><ins>+    resource.m_nextInAllResourcesList = list-&gt;m_head;
</ins><span class="cx">     if (list-&gt;m_head)
</span><del>-        list-&gt;m_head-&gt;m_prevInAllResourcesList = resource;
-    list-&gt;m_head = resource;
</del><ins>+        list-&gt;m_head-&gt;m_prevInAllResourcesList = &amp;resource;
+    list-&gt;m_head = &amp;resource;
</ins><span class="cx">     
</span><del>-    if (!resource-&gt;m_nextInAllResourcesList)
-        list-&gt;m_tail = resource;
</del><ins>+    if (!resource.m_nextInAllResourcesList)
+        list-&gt;m_tail = &amp;resource;
</ins><span class="cx">         
</span><span class="cx"> #if !ASSERT_DISABLED
</span><span class="cx">     // Verify that we are in now in the list like we should be.
</span><span class="cx">     list = lruListFor(resource);
</span><span class="cx">     bool found = false;
</span><span class="cx">     for (CachedResource* current = list-&gt;m_head; current; current = current-&gt;m_nextInAllResourcesList) {
</span><del>-        if (current == resource) {
</del><ins>+        if (current == &amp;resource) {
</ins><span class="cx">             found = true;
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="lines">@@ -537,33 +538,33 @@
</span><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MemoryCache::resourceAccessed(CachedResource* resource)
</del><ins>+void MemoryCache::resourceAccessed(CachedResource&amp; resource)
</ins><span class="cx"> {
</span><del>-    ASSERT(resource-&gt;inCache());
</del><ins>+    ASSERT(resource.inCache());
</ins><span class="cx">     
</span><span class="cx">     // Need to make sure to remove before we increase the access count, since
</span><span class="cx">     // the queue will possibly change.
</span><span class="cx">     removeFromLRUList(resource);
</span><span class="cx">     
</span><span class="cx">     // If this is the first time the resource has been accessed, adjust the size of the cache to account for its initial size.
</span><del>-    if (!resource-&gt;accessCount())
-        adjustSize(resource-&gt;hasClients(), resource-&gt;size());
</del><ins>+    if (!resource.accessCount())
+        adjustSize(resource.hasClients(), resource.size());
</ins><span class="cx">     
</span><span class="cx">     // Add to our access count.
</span><del>-    resource-&gt;increaseAccessCount();
</del><ins>+    resource.increaseAccessCount();
</ins><span class="cx">     
</span><span class="cx">     // Now insert into the new queue.
</span><span class="cx">     insertInLRUList(resource);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MemoryCache::removeResourcesWithOrigin(SecurityOrigin* origin)
</del><ins>+void MemoryCache::removeResourcesWithOrigin(SecurityOrigin&amp; origin)
</ins><span class="cx"> {
</span><span class="cx">     Vector&lt;CachedResource*&gt; resourcesWithOrigin;
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; resources : m_sessionResources) {
</span><span class="cx">         CachedResourceMap::iterator e = resources.value-&gt;end();
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><del>-        String originPartition = ResourceRequest::partitionName(origin-&gt;host());
</del><ins>+        String originPartition = ResourceRequest::partitionName(origin.host());
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">         for (CachedResourceMap::iterator it = resources.value-&gt;begin(); it != e; ++it) {
</span><span class="lines">@@ -581,7 +582,7 @@
</span><span class="cx">                 RefPtr&lt;SecurityOrigin&gt; resourceOrigin = SecurityOrigin::createFromString(resource-&gt;url());
</span><span class="cx">                 if (!resourceOrigin)
</span><span class="cx">                     continue;
</span><del>-                if (resourceOrigin-&gt;equal(origin))
</del><ins>+                if (resourceOrigin-&gt;equal(&amp;origin))
</ins><span class="cx">                     resourcesWithOrigin.append(resource);
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><span class="cx">             }
</span><span class="lines">@@ -589,8 +590,8 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    for (size_t i = 0; i &lt; resourcesWithOrigin.size(); ++i)
-        remove(resourcesWithOrigin[i]);
</del><ins>+    for (auto* resource : resourcesWithOrigin)
+        remove(*resource);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MemoryCache::getOriginsWithCache(SecurityOriginSet&amp; origins)
</span><span class="lines">@@ -613,28 +614,28 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MemoryCache::removeFromLiveDecodedResourcesList(CachedResource* resource)
</del><ins>+void MemoryCache::removeFromLiveDecodedResourcesList(CachedResource&amp; resource)
</ins><span class="cx"> {
</span><del>-    m_liveDecodedResources.remove(resource);
</del><ins>+    m_liveDecodedResources.remove(&amp;resource);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MemoryCache::insertInLiveDecodedResourcesList(CachedResource* resource)
</del><ins>+void MemoryCache::insertInLiveDecodedResourcesList(CachedResource&amp; resource)
</ins><span class="cx"> {
</span><span class="cx">     // Make sure we aren't in the list already.
</span><del>-    ASSERT(!m_liveDecodedResources.contains(resource));
-    m_liveDecodedResources.add(resource);
</del><ins>+    ASSERT(!m_liveDecodedResources.contains(&amp;resource));
+    m_liveDecodedResources.add(&amp;resource);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MemoryCache::addToLiveResourcesSize(CachedResource* resource)
</del><ins>+void MemoryCache::addToLiveResourcesSize(CachedResource&amp; resource)
</ins><span class="cx"> {
</span><del>-    m_liveSize += resource-&gt;size();
-    m_deadSize -= resource-&gt;size();
</del><ins>+    m_liveSize += resource.size();
+    m_deadSize -= resource.size();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MemoryCache::removeFromLiveResourcesSize(CachedResource* resource)
</del><ins>+void MemoryCache::removeFromLiveResourcesSize(CachedResource&amp; resource)
</ins><span class="cx"> {
</span><del>-    m_liveSize -= resource-&gt;size();
-    m_deadSize += resource-&gt;size();
</del><ins>+    m_liveSize -= resource.size();
+    m_deadSize += resource.size();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void MemoryCache::adjustSize(bool live, int delta)
</span><span class="lines">@@ -648,30 +649,29 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MemoryCache::removeRequestFromSessionCaches(ScriptExecutionContext* context, const ResourceRequest&amp; request)
</del><ins>+void MemoryCache::removeRequestFromSessionCaches(ScriptExecutionContext&amp; context, const ResourceRequest&amp; request)
</ins><span class="cx"> {
</span><del>-    ASSERT(context);
-    if (is&lt;WorkerGlobalScope&gt;(*context)) {
</del><ins>+    if (is&lt;WorkerGlobalScope&gt;(context)) {
</ins><span class="cx">         CrossThreadResourceRequestData* requestData = request.copyData().leakPtr();
</span><del>-        downcast&lt;WorkerGlobalScope&gt;(*context).thread().workerLoaderProxy().postTaskToLoader([requestData] (ScriptExecutionContext&amp; context) {
</del><ins>+        downcast&lt;WorkerGlobalScope&gt;(context).thread().workerLoaderProxy().postTaskToLoader([requestData] (ScriptExecutionContext&amp; context) {
</ins><span class="cx">             OwnPtr&lt;ResourceRequest&gt; request(ResourceRequest::adopt(adoptPtr(requestData)));
</span><del>-            MemoryCache::removeRequestFromSessionCaches(&amp;context, *request);
</del><ins>+            MemoryCache::removeRequestFromSessionCaches(context, *request);
</ins><span class="cx">         });
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     for (auto&amp; resources : memoryCache().m_sessionResources) {
</span><span class="cx">         if (CachedResource* resource = memoryCache().resourceForRequestImpl(request, *resources.value))
</span><del>-            memoryCache().remove(resource);
</del><ins>+            memoryCache().remove(*resource);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void MemoryCache::TypeStatistic::addResource(CachedResource* o)
</del><ins>+void MemoryCache::TypeStatistic::addResource(CachedResource&amp; resource)
</ins><span class="cx"> {
</span><span class="cx">     count++;
</span><del>-    size += o-&gt;size();
-    liveSize += o-&gt;hasClients() ? o-&gt;size() : 0;
-    decodedSize += o-&gt;decodedSize();
</del><ins>+    size += resource.size();
+    liveSize += resource.hasClients() ? resource.size() : 0;
+    decodedSize += resource.decodedSize();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> MemoryCache::Statistics MemoryCache::getStatistics()
</span><span class="lines">@@ -683,11 +683,11 @@
</span><span class="cx">         for (CachedResourceMap::iterator i = resources.value-&gt;begin(); i != e; ++i) {
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><span class="cx">             for (CachedResourceItem::iterator itemIterator = i-&gt;value-&gt;begin(); itemIterator != i-&gt;value-&gt;end(); ++itemIterator) {
</span><del>-                CachedResource* resource = itemIterator-&gt;value;
</del><ins>+                CachedResource&amp; resource = *itemIterator-&gt;value;
</ins><span class="cx"> #else
</span><del>-                CachedResource* resource = i-&gt;value;
</del><ins>+                CachedResource&amp; resource = *i-&gt;value;
</ins><span class="cx"> #endif
</span><del>-                switch (resource-&gt;type()) {
</del><ins>+                switch (resource.type()) {
</ins><span class="cx">                 case CachedResource::ImageResource:
</span><span class="cx">                     stats.images.addResource(resource);
</span><span class="cx">                     break;
</span><span class="lines">@@ -726,17 +726,17 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     for (;;) {
</span><del>-        SessionCachedResourceMap::iterator sessionIterator = m_sessionResources.begin();
</del><ins>+        auto sessionIterator = m_sessionResources.begin();
</ins><span class="cx">         if (sessionIterator == m_sessionResources.end())
</span><span class="cx">             break;
</span><del>-        CachedResourceMap::iterator outerIterator = sessionIterator-&gt;value-&gt;begin();
</del><ins>+        auto outerIterator = sessionIterator-&gt;value-&gt;begin();
</ins><span class="cx">         if (outerIterator == sessionIterator-&gt;value-&gt;end())
</span><span class="cx">             break;
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><del>-        CachedResourceItem::iterator innerIterator = outerIterator-&gt;value-&gt;begin();
-        remove(innerIterator-&gt;value);
</del><ins>+        auto innerIterator = outerIterator-&gt;value-&gt;begin();
+        remove(*innerIterator-&gt;value);
</ins><span class="cx"> #else
</span><del>-        remove(outerIterator-&gt;value);
</del><ins>+        remove(*outerIterator-&gt;value);
</ins><span class="cx"> #endif
</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 (179420 => 179421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/MemoryCache.h        2015-01-30 23:58:20 UTC (rev 179420)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.h        2015-01-31 00:04:36 UTC (rev 179421)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx">         { 
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        void addResource(CachedResource*);
</del><ins>+        void addResource(CachedResource&amp;);
</ins><span class="cx">     };
</span><span class="cx">     
</span><span class="cx">     struct Statistics {
</span><span class="lines">@@ -92,13 +92,13 @@
</span><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><del>-    bool add(CachedResource*);
-    void remove(CachedResource*);
</del><ins>+    bool add(CachedResource&amp;);
+    void remove(CachedResource&amp;);
</ins><span class="cx"> 
</span><span class="cx">     static URL removeFragmentIdentifierIfNeeded(const URL&amp; originalURL);
</span><span class="cx">     
</span><del>-    void revalidationSucceeded(CachedResource* revalidatingResource, const ResourceResponse&amp;);
-    void revalidationFailed(CachedResource* revalidatingResource);
</del><ins>+    void revalidationSucceeded(CachedResource&amp; revalidatingResource, const ResourceResponse&amp;);
+    void revalidationFailed(CachedResource&amp; revalidatingResource);
</ins><span class="cx">     
</span><span class="cx">     // Sets the cache's memory capacities, in bytes. These will hold only approximately, 
</span><span class="cx">     // since the decoded cost of resources like scripts and stylesheets is not known.
</span><span class="lines">@@ -120,29 +120,29 @@
</span><span class="cx">     std::chrono::milliseconds deadDecodedDataDeletionInterval() const { return m_deadDecodedDataDeletionInterval; }
</span><span class="cx"> 
</span><span class="cx">     // Calls to put the cached resource into and out of LRU lists.
</span><del>-    void insertInLRUList(CachedResource*);
-    void removeFromLRUList(CachedResource*);
</del><ins>+    void insertInLRUList(CachedResource&amp;);
+    void removeFromLRUList(CachedResource&amp;);
</ins><span class="cx"> 
</span><span class="cx">     // Called to adjust the cache totals when a resource changes size.
</span><span class="cx">     void adjustSize(bool live, int delta);
</span><span class="cx"> 
</span><span class="cx">     // Track decoded resources that are in the cache and referenced by a Web page.
</span><del>-    void insertInLiveDecodedResourcesList(CachedResource*);
-    void removeFromLiveDecodedResourcesList(CachedResource*);
</del><ins>+    void insertInLiveDecodedResourcesList(CachedResource&amp;);
+    void removeFromLiveDecodedResourcesList(CachedResource&amp;);
</ins><span class="cx"> 
</span><del>-    void addToLiveResourcesSize(CachedResource*);
-    void removeFromLiveResourcesSize(CachedResource*);
</del><ins>+    void addToLiveResourcesSize(CachedResource&amp;);
+    void removeFromLiveResourcesSize(CachedResource&amp;);
</ins><span class="cx"> 
</span><del>-    static void removeRequestFromSessionCaches(ScriptExecutionContext*, const ResourceRequest&amp;);
</del><ins>+    static void removeRequestFromSessionCaches(ScriptExecutionContext&amp;, const ResourceRequest&amp;);
</ins><span class="cx"> 
</span><span class="cx">     // Function to collect cache statistics for the caches window in the Safari Debug menu.
</span><span class="cx">     WEBCORE_EXPORT Statistics getStatistics();
</span><span class="cx">     
</span><del>-    void resourceAccessed(CachedResource*);
</del><ins>+    void resourceAccessed(CachedResource&amp;);
</ins><span class="cx">     bool inLiveDecodedResourcesList(CachedResource&amp; resource) const { return m_liveDecodedResources.contains(&amp;resource); }
</span><span class="cx"> 
</span><span class="cx">     typedef HashSet&lt;RefPtr&lt;SecurityOrigin&gt;&gt; SecurityOriginSet;
</span><del>-    WEBCORE_EXPORT void removeResourcesWithOrigin(SecurityOrigin*);
</del><ins>+    WEBCORE_EXPORT void removeResourcesWithOrigin(SecurityOrigin&amp;);
</ins><span class="cx">     WEBCORE_EXPORT void getOriginsWithCache(SecurityOriginSet&amp; origins);
</span><span class="cx"> 
</span><span class="cx"> #if USE(CG)
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx">     MemoryCache();
</span><span class="cx">     ~MemoryCache(); // Not implemented to make sure nobody accidentally calls delete -- WebCore does not delete singletons.
</span><span class="cx"> 
</span><del>-    LRUList* lruListFor(CachedResource*);
</del><ins>+    LRUList* lruListFor(CachedResource&amp;);
</ins><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     void dumpStats();
</span><span class="cx">     void dumpLRULists(bool includeLive) const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMaskImageOperationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MaskImageOperation.cpp (179420 => 179421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MaskImageOperation.cpp        2015-01-30 23:58:20 UTC (rev 179420)
+++ trunk/Source/WebCore/platform/graphics/MaskImageOperation.cpp        2015-01-31 00:04:36 UTC (rev 179421)
</span><span class="lines">@@ -218,7 +218,7 @@
</span><span class="cx">                 // Let the cached resource loader of the document which requested this mask keep a handle to this
</span><span class="cx">                 // cached image to ensure it only gets deleted when it should.
</span><span class="cx">                 if (m_cachedResourceLoader.get())
</span><del>-                    m_cachedResourceLoader-&gt;addCachedResource(m_styleImage-&gt;cachedImage());
</del><ins>+                    m_cachedResourceLoader-&gt;addCachedResource(*m_styleImage-&gt;cachedImage());
</ins><span class="cx">             }
</span><span class="cx">             
</span><span class="cx">             // Destroy the current SVG document as its no longer needed
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (179420 => 179421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-01-30 23:58:20 UTC (rev 179420)
+++ trunk/Source/WebKit2/ChangeLog        2015-01-31 00:04:36 UTC (rev 179421)
</span><span class="lines">@@ -1,5 +1,15 @@
</span><span class="cx"> 2015-01-30  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Update MemoryCache code to use more references instead of pointers
+        https://bugs.webkit.org/show_bug.cgi?id=141099
+
+        Reviewed by Andreas Kling.
+
+        * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
+        (WebKit::WebResourceCacheManager::clearCacheForOrigin):
+
+2015-01-30  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Rename shared() static member functions to singleton() for singleton classes.
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=141088
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessResourceCacheWebResourceCacheManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp (179420 => 179421)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp        2015-01-30 23:58:20 UTC (rev 179420)
+++ trunk/Source/WebKit2/WebProcess/ResourceCache/WebResourceCacheManager.cpp        2015-01-31 00:04:36 UTC (rev 179421)
</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.get());
</del><ins>+    memoryCache().removeResourcesWithOrigin(*origin);
</ins><span class="cx"> 
</span><span class="cx"> #if USE(CFURLCACHE)
</span><span class="cx">     if (resourceCachesToClear != InMemoryResourceCachesOnly) { 
</span></span></pre>
</div>
</div>

</body>
</html>