<!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>[179456] trunk/Source/WebCore</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/179456">179456</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-01-31 19:11:14 -0800 (Sat, 31 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use simpler CachedResourceMap structure in MemoryCache with CACHE_PARTITIONING enabled
https://bugs.webkit.org/show_bug.cgi?id=141110

Reviewed by Antti Koivisto.

Use simpler CachedResourceMap structure in MemoryCache with CACHE_PARTITIONING
enabled. Previously, we would be using a HashMap of HashMap to store
CachedResources. The outer HashMap would use the URL as key and the inner
HashMap would use the partition name as key. This would make traversing the
structure overly complicated, especially considering that the code needs to
traverse a simple HashMap if CACHE_PARTITIONING is disabled.

This patch updates the CachedResourceMap structure to be a simple HashMap,
whose key is an std::pair&lt;URL, String /* partitionName */&gt;. Having a flat
structure simplifies the traversal code a lot and enables more code sharing
between CACHE_PARTITIONING and !CACHE_PARTITIONING. This shouldn't regress
performance because we always have both a URL and a partition name when we
need to look up a resource. We never need to retrieve all resources with
a particular URL.

This patch also switches to using a URL as key instead of a String as we
always have a URL has input.

* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::add):
(WebCore::MemoryCache::revalidationSucceeded):
(WebCore::MemoryCache::resourceForRequestImpl):
(WebCore::MemoryCache::removeImageFromCache):
(WebCore::MemoryCache::remove):
After removing the resource from the CachedResourceMap, remove the
sessionID from m_sessionResources if the CachedResourceMap is now
empty. Previously, no code was removing sessionIDs from
m_sessionResources.

(WebCore::MemoryCache::removeResourcesWithOrigin):
(WebCore::MemoryCache::getOriginsWithCache):
(WebCore::MemoryCache::getStatistics):
(WebCore::MemoryCache::setDisabled):
* loader/cache/MemoryCache.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (179455 => 179456)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-02-01 03:04:21 UTC (rev 179455)
+++ trunk/Source/WebCore/ChangeLog        2015-02-01 03:11:14 UTC (rev 179456)
</span><span class="lines">@@ -1,3 +1,45 @@
</span><ins>+2015-01-31  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Use simpler CachedResourceMap structure in MemoryCache with CACHE_PARTITIONING enabled
+        https://bugs.webkit.org/show_bug.cgi?id=141110
+
+        Reviewed by Antti Koivisto.
+
+        Use simpler CachedResourceMap structure in MemoryCache with CACHE_PARTITIONING
+        enabled. Previously, we would be using a HashMap of HashMap to store
+        CachedResources. The outer HashMap would use the URL as key and the inner
+        HashMap would use the partition name as key. This would make traversing the
+        structure overly complicated, especially considering that the code needs to
+        traverse a simple HashMap if CACHE_PARTITIONING is disabled.
+
+        This patch updates the CachedResourceMap structure to be a simple HashMap,
+        whose key is an std::pair&lt;URL, String /* partitionName */&gt;. Having a flat
+        structure simplifies the traversal code a lot and enables more code sharing
+        between CACHE_PARTITIONING and !CACHE_PARTITIONING. This shouldn't regress
+        performance because we always have both a URL and a partition name when we
+        need to look up a resource. We never need to retrieve all resources with
+        a particular URL.
+
+        This patch also switches to using a URL as key instead of a String as we
+        always have a URL has input.
+
+        * loader/cache/MemoryCache.cpp:
+        (WebCore::MemoryCache::add):
+        (WebCore::MemoryCache::revalidationSucceeded):
+        (WebCore::MemoryCache::resourceForRequestImpl):
+        (WebCore::MemoryCache::removeImageFromCache):
+        (WebCore::MemoryCache::remove):
+        After removing the resource from the CachedResourceMap, remove the
+        sessionID from m_sessionResources if the CachedResourceMap is now
+        empty. Previously, no code was removing sessionIDs from
+        m_sessionResources.
+
+        (WebCore::MemoryCache::removeResourcesWithOrigin):
+        (WebCore::MemoryCache::getOriginsWithCache):
+        (WebCore::MemoryCache::getStatistics):
+        (WebCore::MemoryCache::setDisabled):
+        * loader/cache/MemoryCache.h:
+
</ins><span class="cx"> 2015-01-31  Sam Weinig  &lt;sam@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge the iOS implementations of GraphicsContext::drawText and GraphicsContext::drawBidiText with the platform independent ones
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheMemoryCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/MemoryCache.cpp (179455 => 179456)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/MemoryCache.cpp        2015-02-01 03:04:21 UTC (rev 179455)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.cpp        2015-02-01 03:11:14 UTC (rev 179456)
</span><span class="lines">@@ -110,17 +110,12 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(WTF::isMainThread());
</span><span class="cx"> 
</span><del>-    auto&amp; resources = ensureSessionResourceMap(resource.sessionID());
</del><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><del>-    CachedResourceItem* originMap = resources.get(resource.url());
-    if (!originMap) {
-        originMap = new CachedResourceItem;
-        resources.set(resource.url(), adoptPtr(originMap));
-    }
-    originMap-&gt;set(resource.cachePartition(), &amp;resource);
</del><ins>+    auto key = std::make_pair(resource.url(), resource.cachePartition());
</ins><span class="cx"> #else
</span><del>-    resources.set(resource.url(), &amp;resource);
</del><ins>+    auto&amp; key = resource.url();
</ins><span class="cx"> #endif
</span><ins>+    ensureSessionResourceMap(resource.sessionID()).set(key, &amp;resource);
</ins><span class="cx">     resource.setInCache(true);
</span><span class="cx">     
</span><span class="cx">     resourceAccessed(resource);
</span><span class="lines">@@ -146,17 +141,12 @@
</span><span class="cx"> 
</span><span class="cx">     auto&amp; resources = ensureSessionResourceMap(resource.sessionID());
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><del>-    ASSERT(!resources.get(resource.url()) || !resources.get(resource.url())-&gt;get(resource.cachePartition()));
-    CachedResourceItem* originMap = resources.get(resource.url());
-    if (!originMap) {
-        originMap = new CachedResourceItem;
-        resources.set(resource.url(), adoptPtr(originMap));
-    }
-    originMap-&gt;set(resource.cachePartition(), &amp;resource);
</del><ins>+    auto key = std::make_pair(resource.url(), resource.cachePartition());
</ins><span class="cx"> #else
</span><del>-    ASSERT(!resources.get(resource.url()));
-    resources.set(resource.url(), &amp;resource);
</del><ins>+    auto&amp; key = resource.url();
</ins><span class="cx"> #endif
</span><ins>+    ASSERT(!resources.get(key));
+    resources.set(key, &amp;resource);
</ins><span class="cx">     resource.setInCache(true);
</span><span class="cx">     resource.updateResponseAfterRevalidation(response);
</span><span class="cx">     insertInLRUList(resource);
</span><span class="lines">@@ -199,14 +189,11 @@
</span><span class="cx">     URL url = removeFragmentIdentifierIfNeeded(request.url());
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><del>-    CachedResourceItem* item = resources.get(url);
-    CachedResource* resource = nullptr;
-    if (item)
-        resource = item-&gt;get(request.cachePartition());
</del><ins>+    auto key = std::make_pair(url, request.cachePartition());
</ins><span class="cx"> #else
</span><del>-    CachedResource* resource = resources.get(url);
</del><ins>+    auto&amp; key = url;
</ins><span class="cx"> #endif
</span><del>-    return resource;
</del><ins>+    return resources.get(key);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned MemoryCache::deadCapacity() const 
</span><span class="lines">@@ -262,15 +249,12 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><del>-    CachedResource* resource;
-    if (CachedResourceItem* item = resources-&gt;get(url))
-        resource = item-&gt;get(ResourceRequest::partitionName(domainForCachePartition));
-    else
-        resource = nullptr;
</del><ins>+    auto key = std::make_pair(url, ResourceRequest::partitionName(domainForCachePartition));
</ins><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(domainForCachePartition);
</span><del>-    CachedResource* resource = resources-&gt;get(url);
</del><ins>+    auto&amp; key = url;
</ins><span class="cx"> #endif
</span><ins>+    CachedResource* resource = resources-&gt;get(key);
</ins><span class="cx">     if (!resource)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -428,31 +412,26 @@
</span><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><span class="cx">     if (auto* resources = sessionResourceMap(resource.sessionID())) {
</span><del>-        if (resource.inCache()) {
-            // Remove from the resource map.
</del><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><del>-            CachedResourceItem* item = resources-&gt;get(resource.url());
-            if (item) {
-                item-&gt;remove(resource.cachePartition());
-                if (!item-&gt;size())
-                    resources-&gt;remove(resource.url());
-            }
</del><ins>+        auto key = std::make_pair(resource.url(), resource.cachePartition());
</ins><span class="cx"> #else
</span><del>-            resources-&gt;remove(resource.url());
</del><ins>+        auto&amp; key = resource.url();
</ins><span class="cx"> #endif
</span><ins>+        if (resource.inCache()) {
+            // Remove resource from the resource map.
+            resources-&gt;remove(key);
</ins><span class="cx">             resource.setInCache(false);
</span><span class="cx"> 
</span><ins>+            // If the resource map is now empty, remove it from m_sessionResources.
+            if (resources-&gt;isEmpty())
+                m_sessionResources.remove(resource.sessionID());
+
</ins><span class="cx">             // Remove from the appropriate LRU list.
</span><span class="cx">             removeFromLRUList(resource);
</span><span class="cx">             removeFromLiveDecodedResourcesList(resource);
</span><span class="cx">             adjustSize(resource.hasClients(), -static_cast&lt;int&gt;(resource.size()));
</span><del>-        } else {
-#if ENABLE(CACHE_PARTITIONING)
-            ASSERT(!resources-&gt;get(resource.url()) || resources-&gt;get(resource.url())-&gt;get(resource.cachePartition()) != &amp;resource);
-#else
-            ASSERT(resources-&gt;get(resource.url()) != &amp;resource);
-#endif
-        }
</del><ins>+        } else
+            ASSERT(resources-&gt;get(key) != &amp;resource);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     resource.deleteIfPossible();
</span><span class="lines">@@ -570,34 +549,24 @@
</span><span class="cx"> 
</span><span class="cx"> void MemoryCache::removeResourcesWithOrigin(SecurityOrigin&amp; origin)
</span><span class="cx"> {
</span><del>-    Vector&lt;CachedResource*&gt; resourcesWithOrigin;
-
-    for (auto&amp; resources : m_sessionResources) {
-        CachedResourceMap::iterator e = resources.value-&gt;end();
</del><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><del>-        String originPartition = ResourceRequest::partitionName(origin.host());
</del><ins>+    String originPartition = ResourceRequest::partitionName(origin.host());
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-        for (CachedResourceMap::iterator it = resources.value-&gt;begin(); it != e; ++it) {
</del><ins>+    Vector&lt;CachedResource*&gt; resourcesWithOrigin;
+    for (auto&amp; resources : m_sessionResources.values()) {
+        for (auto&amp; keyValue : *resources) {
+            auto&amp; resource = *keyValue.value;
</ins><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><del>-            for (CachedResourceItem::iterator itemIterator = it-&gt;value-&gt;begin(); itemIterator != it-&gt;value-&gt;end(); ++itemIterator) {
-                CachedResource* resource = itemIterator-&gt;value;
-                String partition = itemIterator-&gt;key;
-                if (partition == originPartition) {
-                    resourcesWithOrigin.append(resource);
-                    continue;
-                }
-#else
-                CachedResource* resource = it-&gt;value;
-#endif
-                RefPtr&lt;SecurityOrigin&gt; resourceOrigin = SecurityOrigin::createFromString(resource-&gt;url());
-                if (!resourceOrigin)
-                    continue;
-                if (resourceOrigin-&gt;equal(&amp;origin))
-                    resourcesWithOrigin.append(resource);
-#if ENABLE(CACHE_PARTITIONING)
</del><ins>+            auto&amp; partitionName = keyValue.key.second;
+            if (partitionName == originPartition) {
+                resourcesWithOrigin.append(&amp;resource);
+                continue;
</ins><span class="cx">             }
</span><span class="cx"> #endif
</span><ins>+            RefPtr&lt;SecurityOrigin&gt; resourceOrigin = SecurityOrigin::create(resource.url());
+            if (resourceOrigin-&gt;equal(&amp;origin))
+                resourcesWithOrigin.append(&amp;resource);
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -608,19 +577,18 @@
</span><span class="cx"> void MemoryCache::getOriginsWithCache(SecurityOriginSet&amp; origins)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><del>-    DEPRECATED_DEFINE_STATIC_LOCAL(String, httpString, (&quot;http&quot;));
</del><ins>+    static NeverDestroyed&lt;String&gt; httpString(&quot;http&quot;);
</ins><span class="cx"> #endif
</span><del>-    for (auto&amp; resources : m_sessionResources) {
-        CachedResourceMap::iterator e = resources.value-&gt;end();
-        for (CachedResourceMap::iterator it = resources.value-&gt;begin(); it != e; ++it) {
</del><ins>+    for (auto&amp; resources : m_sessionResources.values()) {
+        for (auto&amp; keyValue : *resources) {
+            auto&amp; resource = *keyValue.value;
</ins><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><del>-            if (it-&gt;value-&gt;begin()-&gt;key == emptyString())
-                origins.add(SecurityOrigin::createFromString(it-&gt;value-&gt;begin()-&gt;value-&gt;url()));
</del><ins>+            auto&amp; partitionName = keyValue.key.second;
+            if (!partitionName.isEmpty())
+                origins.add(SecurityOrigin::create(httpString, partitionName, 0));
</ins><span class="cx">             else
</span><del>-                origins.add(SecurityOrigin::create(httpString, it-&gt;value-&gt;begin()-&gt;key, 0));
-#else
-            origins.add(SecurityOrigin::createFromString(it-&gt;value-&gt;url()));
</del><span class="cx"> #endif
</span><ins>+            origins.add(SecurityOrigin::create(resource.url()));
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="lines">@@ -689,42 +657,32 @@
</span><span class="cx"> {
</span><span class="cx">     Statistics stats;
</span><span class="cx"> 
</span><del>-    for (auto&amp; resources : m_sessionResources) {
-        CachedResourceMap::iterator e = resources.value-&gt;end();
-        for (CachedResourceMap::iterator i = resources.value-&gt;begin(); i != e; ++i) {
-#if ENABLE(CACHE_PARTITIONING)
-            for (CachedResourceItem::iterator itemIterator = i-&gt;value-&gt;begin(); itemIterator != i-&gt;value-&gt;end(); ++itemIterator) {
-                CachedResource&amp; resource = *itemIterator-&gt;value;
-#else
-                CachedResource&amp; resource = *i-&gt;value;
-#endif
-                switch (resource.type()) {
-                case CachedResource::ImageResource:
-                    stats.images.addResource(resource);
-                    break;
-                case CachedResource::CSSStyleSheet:
-                    stats.cssStyleSheets.addResource(resource);
-                    break;
-                case CachedResource::Script:
-                    stats.scripts.addResource(resource);
-                    break;
</del><ins>+    for (auto&amp; resources : m_sessionResources.values()) {
+        for (auto* resource : resources-&gt;values()) {
+            switch (resource-&gt;type()) {
+            case CachedResource::ImageResource:
+                stats.images.addResource(*resource);
+                break;
+            case CachedResource::CSSStyleSheet:
+                stats.cssStyleSheets.addResource(*resource);
+                break;
+            case CachedResource::Script:
+                stats.scripts.addResource(*resource);
+                break;
</ins><span class="cx"> #if ENABLE(XSLT)
</span><del>-                case CachedResource::XSLStyleSheet:
-                    stats.xslStyleSheets.addResource(resource);
-                    break;
</del><ins>+            case CachedResource::XSLStyleSheet:
+                stats.xslStyleSheets.addResource(*resource);
+                break;
</ins><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><del>-                case CachedResource::SVGFontResource:
</del><ins>+            case CachedResource::SVGFontResource:
</ins><span class="cx"> #endif
</span><del>-                case CachedResource::FontResource:
-                    stats.fonts.addResource(resource);
-                    break;
-                default:
-                    break;
-                }
-#if ENABLE(CACHE_PARTITIONING)
</del><ins>+            case CachedResource::FontResource:
+                stats.fonts.addResource(*resource);
+                break;
+            default:
+                break;
</ins><span class="cx">             }
</span><del>-#endif
</del><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx">     return stats;
</span><span class="lines">@@ -736,19 +694,10 @@
</span><span class="cx">     if (!m_disabled)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    for (;;) {
-        auto sessionIterator = m_sessionResources.begin();
-        if (sessionIterator == m_sessionResources.end())
-            break;
-        auto outerIterator = sessionIterator-&gt;value-&gt;begin();
-        if (outerIterator == sessionIterator-&gt;value-&gt;end())
-            break;
-#if ENABLE(CACHE_PARTITIONING)
-        auto innerIterator = outerIterator-&gt;value-&gt;begin();
-        remove(*innerIterator-&gt;value);
-#else
-        remove(*outerIterator-&gt;value);
-#endif
</del><ins>+    while (!m_sessionResources.isEmpty()) {
+        auto&amp; resources = *m_sessionResources.begin()-&gt;value;
+        ASSERT(!resources.isEmpty());
+        remove(*resources.begin()-&gt;value);
</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 (179455 => 179456)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/MemoryCache.h        2015-02-01 03:04:21 UTC (rev 179455)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.h        2015-02-01 03:11:14 UTC (rev 179456)
</span><span class="lines">@@ -159,10 +159,9 @@
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx"> #if ENABLE(CACHE_PARTITIONING)
</span><del>-    typedef HashMap&lt;String, CachedResource*&gt; CachedResourceItem;
-    typedef HashMap&lt;String, OwnPtr&lt;CachedResourceItem&gt;&gt; CachedResourceMap;
</del><ins>+    typedef HashMap&lt;std::pair&lt;URL, String /* partitionName */&gt;, CachedResource*&gt; CachedResourceMap;
</ins><span class="cx"> #else
</span><del>-    typedef HashMap&lt;String, CachedResource*&gt; CachedResourceMap;
</del><ins>+    typedef HashMap&lt;URL, CachedResource*&gt; CachedResourceMap;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     struct LRUList {
</span></span></pre>
</div>
</div>

</body>
</html>