[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

zecke at webkit.org zecke at webkit.org
Wed Apr 7 23:12:01 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit fe6efe31de9a833a56e709afd9f928ed3d57667f
Author: zecke at webkit.org <zecke at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 28 11:44:23 2009 +0000

    Document a feature of the m_liveDecodedResources list.
    
    https://bugs.webkit.org/show_bug.cgi?id=30209
    Reviewed by Darin Adler.
    
    Document a feature of the m_liveDecodedResources list.
    https://bugs.webkit.org/show_bug.cgi?id=30209
    
    The code made the assumption that the list is sorted by
    the m_lastDecodedAccessTime property of the CachedResource.
    The above is not true when CachedResource::setDecodedSize
    is called and the item is inserted the first time. In this
    case the m_lastDecodedAccessTime is still zero and the
    m_liveDecodedResources list becomes unsorted.
    
    It is impossible that Cache::pruneLiveResources will
    stop to process the list too early due this feature and
    the alternatives of updating m_lastDecodedAccessTime in
    CachedResource::setDecodedSize or changing the insert
    to search the right position have a negative impact on
    performance. The best solution for now is to document
    this feature.
    
    * loader/Cache.cpp:
    (WebCore::Cache::pruneLiveResources):
    * loader/CachedResource.cpp:
    (WebCore::CachedResource::setDecodedSize):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50213 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5420dc7..66a9e10 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,30 @@
+2009-10-26  Holger Hans Peter Freyther  <zecke at selfish.org>
+
+        Reviewed by Darin Adler.
+
+        Document a feature of the m_liveDecodedResources list.
+        https://bugs.webkit.org/show_bug.cgi?id=30209
+
+        The code made the assumption that the list is sorted by
+        the m_lastDecodedAccessTime property of the CachedResource.
+        The above is not true when CachedResource::setDecodedSize
+        is called and the item is inserted the first time. In this
+        case the m_lastDecodedAccessTime is still zero and the
+        m_liveDecodedResources list becomes unsorted.
+
+        It is impossible that Cache::pruneLiveResources will
+        stop to process the list too early due this feature and
+        the alternatives of updating m_lastDecodedAccessTime in
+        CachedResource::setDecodedSize or changing the insert
+        to search the right position have a negative impact on
+        performance. The best solution for now is to document
+        this feature.
+
+        * loader/Cache.cpp:
+        (WebCore::Cache::pruneLiveResources):
+        * loader/CachedResource.cpp:
+        (WebCore::CachedResource::setDecodedSize):
+
 2009-10-28  Xan Lopez  <xlopez at igalia.com>
 
         Reviewed by Jan Alonzo.
diff --git a/WebCore/loader/Cache.cpp b/WebCore/loader/Cache.cpp
index 391790f..46fb068 100644
--- a/WebCore/loader/Cache.cpp
+++ b/WebCore/loader/Cache.cpp
@@ -275,6 +275,12 @@ void Cache::pruneLiveResources()
     
     // Destroy any decoded data in live objects that we can.
     // Start from the tail, since this is the least recently accessed of the objects.
+
+    // The list might not be sorted by the m_lastDecodedAccessTime. The impact
+    // of this weaker invariant is minor as the below if statement to check the
+    // elapsedTime will evaluate to false as the currentTime will be a lot
+    // greater than the current->m_lastDecodedAccessTime.
+    // For more details see: https://bugs.webkit.org/show_bug.cgi?id=30209
     CachedResource* current = m_liveDecodedResources.m_tail;
     while (current) {
         CachedResource* prev = current->m_prevInLiveResourcesList;
diff --git a/WebCore/loader/CachedResource.cpp b/WebCore/loader/CachedResource.cpp
index 43de633..f2f52b0 100644
--- a/WebCore/loader/CachedResource.cpp
+++ b/WebCore/loader/CachedResource.cpp
@@ -242,6 +242,12 @@ void CachedResource::setDecodedSize(unsigned size)
         cache()->insertInLRUList(this);
         
         // Insert into or remove from the live decoded list if necessary.
+        // When inserting into the LiveDecodedResourcesList it is possible
+        // that the m_lastDecodedAccessTime is still zero or smaller than
+        // the m_lastDecodedAccessTime of the current list head. This is a
+        // violation of the invariant that the list is to be kept sorted
+        // by access time. The weakening of the invariant does not pose
+        // a problem. For more details please see: https://bugs.webkit.org/show_bug.cgi?id=30209
         if (m_decodedSize && !m_inLiveDecodedResourcesList && hasClients())
             cache()->insertInLiveDecodedResourcesList(this);
         else if (!m_decodedSize && m_inLiveDecodedResourcesList)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list