[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

joepeck at webkit.org joepeck at webkit.org
Wed Dec 22 14:46:05 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit cbb1b34fd37bc85a8f33bc07ce0c7c23c15a657b
Author: joepeck at webkit.org <joepeck at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 19 20:34:32 2010 +0000

    2010-10-19  Joseph Pecoraro  <joepeck at webkit.org>
    
            Reviewed by David Kilzer.
    
            iOS: ASSERT in Cache::adjustSize running layout tests
            https://bugs.webkit.org/show_bug.cgi?id=47873
    
            Inside Cache::pruneDeadResources we loop over the LRU lists and make resources purgeable
            with Cache::makeResourcePurgeable(). This wasn't taking into account whether the resource
            was already purgeable or not, and the makeResourcePurgeable call was always calling
            adjustSize(). Now we make sure makeResourcePurgable only adjusts the size of the Cache's
            dead sizes when it first marks the resource purgeable. Likewise, if a resource is marked
            as purgeable and then evicted, we should not adjust the size again.
    
            The balancing call is when we have a resource that has been marked as purgeable and we
            successfully mark it as no longer purgeable in Cache::resourceForURL.
    
            No test added because this requires testing purgeable memory.
    
            * loader/Cache.cpp:
            (WebCore::Cache::makeResourcePurgeable):
            (WebCore::Cache::evict):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70077 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 82bb0b8..51a85be 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,26 @@
+2010-10-19  Joseph Pecoraro  <joepeck at webkit.org>
+
+        Reviewed by David Kilzer.
+
+        iOS: ASSERT in Cache::adjustSize running layout tests
+        https://bugs.webkit.org/show_bug.cgi?id=47873
+
+        Inside Cache::pruneDeadResources we loop over the LRU lists and make resources purgeable
+        with Cache::makeResourcePurgeable(). This wasn't taking into account whether the resource
+        was already purgeable or not, and the makeResourcePurgeable call was always calling
+        adjustSize(). Now we make sure makeResourcePurgable only adjusts the size of the Cache's
+        dead sizes when it first marks the resource purgeable. Likewise, if a resource is marked
+        as purgeable and then evicted, we should not adjust the size again.
+
+        The balancing call is when we have a resource that has been marked as purgeable and we
+        successfully mark it as no longer purgeable in Cache::resourceForURL.
+
+        No test added because this requires testing purgeable memory.
+
+        * loader/Cache.cpp:
+        (WebCore::Cache::makeResourcePurgeable):
+        (WebCore::Cache::evict):
+
 2010-10-19  Vangelis Kokkevis  <vangelis at chromium.org>
 
         Reviewed by Kenneth Russell.
diff --git a/WebCore/loader/Cache.cpp b/WebCore/loader/Cache.cpp
index d676538..6ef65c0 100644
--- a/WebCore/loader/Cache.cpp
+++ b/WebCore/loader/Cache.cpp
@@ -424,6 +424,9 @@ bool Cache::makeResourcePurgeable(CachedResource* resource)
     if (!resource->inCache())
         return false;
 
+    if (resource->isPurgeable())
+        return true;
+
     if (!resource->isSafeToMakePurgeable())
         return false;
 
@@ -450,8 +453,9 @@ void Cache::evict(CachedResource* resource)
         removeFromLiveDecodedResourcesList(resource);
 
         // If the resource was purged, it means we had already decremented the size when we made the
-        // resource purgeable in makeResourcePurgeable().
-        if (!Cache::shouldMakeResourcePurgeableOnEviction() || !resource->wasPurged())
+        // resource purgeable in makeResourcePurgeable(). So adjust the size if we are evicting a
+        // resource that was not marked as purgeable.
+        if (!Cache::shouldMakeResourcePurgeableOnEviction() || !resource->isPurgeable())
             adjustSize(resource->hasClients(), -static_cast<int>(resource->size()));
     } else
         ASSERT(m_resources.get(resource->url()) != resource);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list