<!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>[35921] trunk/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/35921">35921</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2008-08-25 13:41:11 -0700 (Mon, 25 Aug 2008)</dd>
</dl>

<h3>Log Message</h3>
<pre>2008-08-25  Antti Koivisto  &lt;antti@apple.com&gt;

        Reviewed by Dan Bernstein.

        Rename CachedResource::referenced() to CachedResource::hasClients() to
        match previous ref() -&gt; addClient() rename.

        * loader/Cache.cpp:
        (WebCore::Cache::pruneLiveResources):
        (WebCore::Cache::pruneDeadResources):
        (WebCore::Cache::remove):
        (WebCore::Cache::getStatistics):
        (WebCore::Cache::dumpLRULists):
        * loader/CachedResource.cpp:
        (WebCore::CachedResource::addClient):
        (WebCore::CachedResource::removeClient):
        (WebCore::CachedResource::setDecodedSize):
        (WebCore::CachedResource::setEncodedSize):
        * loader/CachedResource.h:
        (WebCore::CachedResource::hasClients):
        (WebCore::CachedResource::canDelete):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreloaderCachecpp">trunk/WebCore/loader/Cache.cpp</a></li>
<li><a href="#trunkWebCoreloaderCachedResourcecpp">trunk/WebCore/loader/CachedResource.cpp</a></li>
<li><a href="#trunkWebCoreloaderCachedResourceh">trunk/WebCore/loader/CachedResource.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (35920 => 35921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2008-08-25 19:53:57 UTC (rev 35920)
+++ trunk/WebCore/ChangeLog        2008-08-25 20:41:11 UTC (rev 35921)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2008-08-25  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        Reviewed by Dan Bernstein.
+
+        Rename CachedResource::referenced() to CachedResource::hasClients() to
+        match previous ref() -&gt; addClient() rename.
+
+        * loader/Cache.cpp:
+        (WebCore::Cache::pruneLiveResources):
+        (WebCore::Cache::pruneDeadResources):
+        (WebCore::Cache::remove):
+        (WebCore::Cache::getStatistics):
+        (WebCore::Cache::dumpLRULists):
+        * loader/CachedResource.cpp:
+        (WebCore::CachedResource::addClient):
+        (WebCore::CachedResource::removeClient):
+        (WebCore::CachedResource::setDecodedSize):
+        (WebCore::CachedResource::setEncodedSize):
+        * loader/CachedResource.h:
+        (WebCore::CachedResource::hasClients):
+        (WebCore::CachedResource::canDelete):
+
</ins><span class="cx"> 2008-08-25  Anthony Ricaud  &lt;rik24d@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Add a missing Inspector localized string for &quot;other&quot;.
</span></span></pre></div>
<a id="trunkWebCoreloaderCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/loader/Cache.cpp (35920 => 35921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/loader/Cache.cpp        2008-08-25 19:53:57 UTC (rev 35920)
+++ trunk/WebCore/loader/Cache.cpp        2008-08-25 20:41:11 UTC (rev 35921)
</span><span class="lines">@@ -227,7 +227,7 @@
</span><span class="cx">     CachedResource* current = m_liveDecodedResources.m_tail;
</span><span class="cx">     while (current) {
</span><span class="cx">         CachedResource* prev = current-&gt;m_prevInLiveResourcesList;
</span><del>-        ASSERT(current-&gt;referenced());
</del><ins>+        ASSERT(current-&gt;hasClients());
</ins><span class="cx">         if (current-&gt;isLoaded() &amp;&amp; current-&gt;decodedSize()) {
</span><span class="cx">             // Check to see if the remaining resources are too new to prune.
</span><span class="cx">             double elapsedTime = currentTime - current-&gt;m_lastDecodedAccessTime;
</span><span class="lines">@@ -265,7 +265,7 @@
</span><span class="cx">         // First flush all the decoded data in this queue.
</span><span class="cx">         while (current) {
</span><span class="cx">             CachedResource* prev = current-&gt;m_prevInAllResourcesList;
</span><del>-            if (!current-&gt;referenced() &amp;&amp; !current-&gt;isPreloaded() &amp;&amp; current-&gt;isLoaded() &amp;&amp; current-&gt;decodedSize()) {
</del><ins>+            if (!current-&gt;hasClients() &amp;&amp; !current-&gt;isPreloaded() &amp;&amp; current-&gt;isLoaded() &amp;&amp; current-&gt;decodedSize()) {
</ins><span class="cx">                 // Destroy our decoded data. This will remove us from 
</span><span class="cx">                 // m_liveDecodedResources, and possibly move us to a differnt 
</span><span class="cx">                 // LRU list in m_allResources.
</span><span class="lines">@@ -281,7 +281,7 @@
</span><span class="cx">         current = m_allResources[i].m_tail;
</span><span class="cx">         while (current) {
</span><span class="cx">             CachedResource* prev = current-&gt;m_prevInAllResourcesList;
</span><del>-            if (!current-&gt;referenced() &amp;&amp; !current-&gt;isPreloaded()) {
</del><ins>+            if (!current-&gt;hasClients() &amp;&amp; !current-&gt;isPreloaded()) {
</ins><span class="cx">                 remove(current);
</span><span class="cx"> 
</span><span class="cx">                 if (m_deadSize &lt;= targetSize)
</span><span class="lines">@@ -331,7 +331,7 @@
</span><span class="cx">         // Subtract from our size totals.
</span><span class="cx">         int delta = -static_cast&lt;int&gt;(resource-&gt;size());
</span><span class="cx">         if (delta)
</span><del>-            adjustSize(resource-&gt;referenced(), delta);
</del><ins>+            adjustSize(resource-&gt;hasClients(), delta);
</ins><span class="cx">     } else
</span><span class="cx">         ASSERT(m_resources.get(resource-&gt;url()) != resource);
</span><span class="cx"> 
</span><span class="lines">@@ -573,42 +573,42 @@
</span><span class="cx">             case CachedResource::ImageResource:
</span><span class="cx">                 stats.images.count++;
</span><span class="cx">                 stats.images.size += o-&gt;size();
</span><del>-                stats.images.liveSize += o-&gt;referenced() ? o-&gt;size() : 0;
</del><ins>+                stats.images.liveSize += o-&gt;hasClients() ? o-&gt;size() : 0;
</ins><span class="cx">                 stats.images.decodedSize += o-&gt;decodedSize();
</span><span class="cx">                 break;
</span><span class="cx"> 
</span><span class="cx">             case CachedResource::CSSStyleSheet:
</span><span class="cx">                 stats.cssStyleSheets.count++;
</span><span class="cx">                 stats.cssStyleSheets.size += o-&gt;size();
</span><del>-                stats.cssStyleSheets.liveSize += o-&gt;referenced() ? o-&gt;size() : 0;
</del><ins>+                stats.cssStyleSheets.liveSize += o-&gt;hasClients() ? o-&gt;size() : 0;
</ins><span class="cx">                 stats.cssStyleSheets.decodedSize += o-&gt;decodedSize();
</span><span class="cx">                 break;
</span><span class="cx"> 
</span><span class="cx">             case CachedResource::Script:
</span><span class="cx">                 stats.scripts.count++;
</span><span class="cx">                 stats.scripts.size += o-&gt;size();
</span><del>-                stats.scripts.liveSize += o-&gt;referenced() ? o-&gt;size() : 0;
</del><ins>+                stats.scripts.liveSize += o-&gt;hasClients() ? o-&gt;size() : 0;
</ins><span class="cx">                 stats.scripts.decodedSize += o-&gt;decodedSize();
</span><span class="cx">                 break;
</span><span class="cx"> #if ENABLE(XSLT)
</span><span class="cx">             case CachedResource::XSLStyleSheet:
</span><span class="cx">                 stats.xslStyleSheets.count++;
</span><span class="cx">                 stats.xslStyleSheets.size += o-&gt;size();
</span><del>-                stats.xslStyleSheets.liveSize += o-&gt;referenced() ? o-&gt;size() : 0;
</del><ins>+                stats.xslStyleSheets.liveSize += o-&gt;hasClients() ? o-&gt;size() : 0;
</ins><span class="cx">                 stats.xslStyleSheets.decodedSize += o-&gt;decodedSize();
</span><span class="cx">                 break;
</span><span class="cx"> #endif
</span><span class="cx">             case CachedResource::FontResource:
</span><span class="cx">                 stats.fonts.count++;
</span><span class="cx">                 stats.fonts.size += o-&gt;size();
</span><del>-                stats.fonts.liveSize += o-&gt;referenced() ? o-&gt;size() : 0;
</del><ins>+                stats.fonts.liveSize += o-&gt;hasClients() ? o-&gt;size() : 0;
</ins><span class="cx">                 stats.fonts.decodedSize += o-&gt;decodedSize();
</span><span class="cx">                 break;
</span><span class="cx"> #if ENABLE(XBL)
</span><span class="cx">             case CachedResource::XBL:
</span><span class="cx">                 stats.xblDocs.count++;
</span><span class="cx">                 stats.xblDocs.size += o-&gt;size();
</span><del>-                stats.xblDocs.liveSize += o-&gt;referenced() ? o-&gt;size() : 0;
</del><ins>+                stats.xblDocs.liveSize += o-&gt;hasClients() ? o-&gt;size() : 0;
</ins><span class="cx">                 stats.xblDocs.decodedSize += o-&gt;decodedSize();
</span><span class="cx">                 break;
</span><span class="cx"> #endif
</span><span class="lines">@@ -645,8 +645,8 @@
</span><span class="cx">         CachedResource* current = m_allResources[i].m_tail;
</span><span class="cx">         while (current) {
</span><span class="cx">             CachedResource* prev = current-&gt;m_prevInAllResourcesList;
</span><del>-            if (includeLive || !current-&gt;referenced())
-                printf(&quot;(%.1fK, %.1fK, %uA, %dR); &quot;, current-&gt;decodedSize() / 1024.0f, current-&gt;encodedSize() / 1024.0f, current-&gt;accessCount(), current-&gt;referenced());
</del><ins>+            if (includeLive || !current-&gt;hasClients())
+                printf(&quot;(%.1fK, %.1fK, %uA, %dR); &quot;, current-&gt;decodedSize() / 1024.0f, current-&gt;encodedSize() / 1024.0f, current-&gt;accessCount(), current-&gt;hasClients());
</ins><span class="cx">             current = prev;
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkWebCoreloaderCachedResourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/loader/CachedResource.cpp (35920 => 35921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/loader/CachedResource.cpp        2008-08-25 19:53:57 UTC (rev 35920)
+++ trunk/WebCore/loader/CachedResource.cpp        2008-08-25 20:41:11 UTC (rev 35921)
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx">         else
</span><span class="cx">             m_preloadResult = PreloadReferenced;
</span><span class="cx">     }
</span><del>-    if (!referenced() &amp;&amp; inCache())
</del><ins>+    if (!hasClients() &amp;&amp; inCache())
</ins><span class="cx">         cache()-&gt;addToLiveResourcesSize(this);
</span><span class="cx">     m_clients.add(c);
</span><span class="cx"> }
</span><span class="lines">@@ -131,7 +131,7 @@
</span><span class="cx">     m_clients.remove(c);
</span><span class="cx">     if (canDelete() &amp;&amp; !inCache())
</span><span class="cx">         delete this;
</span><del>-    else if (!referenced() &amp;&amp; inCache()) {
</del><ins>+    else if (!hasClients() &amp;&amp; inCache()) {
</ins><span class="cx">         cache()-&gt;removeFromLiveResourcesSize(this);
</span><span class="cx">         cache()-&gt;removeFromLiveDecodedResourcesList(this);
</span><span class="cx">         allReferencesRemoved();
</span><span class="lines">@@ -159,13 +159,13 @@
</span><span class="cx">         cache()-&gt;insertInLRUList(this);
</span><span class="cx">         
</span><span class="cx">         // Insert into or remove from the live decoded list if necessary.
</span><del>-        if (m_decodedSize &amp;&amp; !m_inLiveDecodedResourcesList &amp;&amp; referenced())
</del><ins>+        if (m_decodedSize &amp;&amp; !m_inLiveDecodedResourcesList &amp;&amp; hasClients())
</ins><span class="cx">             cache()-&gt;insertInLiveDecodedResourcesList(this);
</span><span class="cx">         else if (!m_decodedSize &amp;&amp; m_inLiveDecodedResourcesList)
</span><span class="cx">             cache()-&gt;removeFromLiveDecodedResourcesList(this);
</span><span class="cx"> 
</span><span class="cx">         // Update the cache's size totals.
</span><del>-        cache()-&gt;adjustSize(referenced(), delta);
</del><ins>+        cache()-&gt;adjustSize(hasClients(), delta);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -192,7 +192,7 @@
</span><span class="cx">         cache()-&gt;insertInLRUList(this);
</span><span class="cx">         
</span><span class="cx">         // Update the cache's size totals.
</span><del>-        cache()-&gt;adjustSize(referenced(), delta);
</del><ins>+        cache()-&gt;adjustSize(hasClients(), delta);
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkWebCoreloaderCachedResourceh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/loader/CachedResource.h (35920 => 35921)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/loader/CachedResource.h        2008-08-25 19:53:57 UTC (rev 35920)
+++ trunk/WebCore/loader/CachedResource.h        2008-08-25 20:41:11 UTC (rev 35921)
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx"> 
</span><span class="cx">     virtual void addClient(CachedResourceClient*);
</span><span class="cx">     void removeClient(CachedResourceClient*);
</span><del>-    bool referenced() const { return !m_clients.isEmpty(); }
</del><ins>+    bool hasClients() const { return !m_clients.isEmpty(); }
</ins><span class="cx"> 
</span><span class="cx">     enum PreloadResult {
</span><span class="cx">         PreloadNotReferenced,
</span><span class="lines">@@ -131,7 +131,7 @@
</span><span class="cx">     void setResponse(const ResourceResponse&amp; response) { m_response = response; }
</span><span class="cx">     const ResourceResponse&amp; response() const { return m_response; }
</span><span class="cx">     
</span><del>-    bool canDelete() const { return !referenced() &amp;&amp; !m_request &amp;&amp; !m_preloadCount; }
</del><ins>+    bool canDelete() const { return !hasClients() &amp;&amp; !m_request &amp;&amp; !m_preloadCount; }
</ins><span class="cx"> 
</span><span class="cx">     bool isExpired() const;
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>