Title: [183260] trunk
Revision
183260
Author
[email protected]
Date
2015-04-24 04:16:34 -0700 (Fri, 24 Apr 2015)

Log Message

Unreviewed, rolling out r183259.

Wrong ChangeLog.

Reverted changeset:

"Memory cache live resources repeatedly purged during
painting"
https://bugs.webkit.org/show_bug.cgi?id=144104
http://trac.webkit.org/changeset/183259

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (183259 => 183260)


--- trunk/LayoutTests/ChangeLog	2015-04-24 11:05:40 UTC (rev 183259)
+++ trunk/LayoutTests/ChangeLog	2015-04-24 11:16:34 UTC (rev 183260)
@@ -1,5 +1,18 @@
 2015-04-24  Antti Koivisto  <[email protected]>
 
+        Unreviewed, rolling out r183259.
+
+        Wrong ChangeLog.
+
+        Reverted changeset:
+
+        "Memory cache live resources repeatedly purged during
+        painting"
+        https://bugs.webkit.org/show_bug.cgi?id=144104
+        http://trac.webkit.org/changeset/183259
+
+2015-04-24  Antti Koivisto  <[email protected]>
+
         Memory cache live resources repeatedly purged during painting
         https://bugs.webkit.org/show_bug.cgi?id=144104
 

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie.html (183259 => 183260)


--- trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie.html	2015-04-24 11:05:40 UTC (rev 183259)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/disk-cache-vary-cookie.html	2015-04-24 11:16:34 UTC (rev 183260)
@@ -15,13 +15,16 @@
 document.cookie = "cookie=value";
 loadResources(tests, function () {
     printResults(tests);
+    internals.clearMemoryCache();
     debug("Loading again");
     loadResources(tests, function () {
         printResults(tests);
+        internals.clearMemoryCache();
         debug("Changing cookie and loading");
         document.cookie = "cookie=othervalue";
         loadResources(tests, function () {
             printResults(tests);
+            internals.clearMemoryCache()
             debug("Loading again");
             loadResources(tests, function () {
                printResults(tests);

Modified: trunk/LayoutTests/http/tests/cache/disk-cache/resources/cache-test.js (183259 => 183260)


--- trunk/LayoutTests/http/tests/cache/disk-cache/resources/cache-test.js	2015-04-24 11:05:40 UTC (rev 183259)
+++ trunk/LayoutTests/http/tests/cache/disk-cache/resources/cache-test.js	2015-04-24 11:16:34 UTC (rev 183260)
@@ -69,9 +69,6 @@
 
 function loadResources(tests, completetion)
 {
-    // Otherwise we just get responses from the memory cache.
-    internals.clearMemoryCache();
-    
     var pendingCount = tests.length;
     for (var i = 0; i < tests.length; ++i) {
         loadResource(tests[i], function (ev) {
@@ -100,6 +97,8 @@
 function runTests(tests, completionHandler)
 {
     loadResources(tests, function () {
+        // Otherwise we just get responses from the memory cache.
+        internals.clearMemoryCache();
         // Wait a bit so things settle down in the disk cache.
         setTimeout(function () {
             loadResources(tests, function () {

Modified: trunk/Source/WebCore/ChangeLog (183259 => 183260)


--- trunk/Source/WebCore/ChangeLog	2015-04-24 11:05:40 UTC (rev 183259)
+++ trunk/Source/WebCore/ChangeLog	2015-04-24 11:16:34 UTC (rev 183260)
@@ -1,5 +1,18 @@
 2015-04-24  Antti Koivisto  <[email protected]>
 
+        Unreviewed, rolling out r183259.
+
+        Wrong ChangeLog.
+
+        Reverted changeset:
+
+        "Memory cache live resources repeatedly purged during
+        painting"
+        https://bugs.webkit.org/show_bug.cgi?id=144104
+        http://trac.webkit.org/changeset/183259
+
+2015-04-24  Antti Koivisto  <[email protected]>
+
         CrashTracer: WebProcess at com.apple.WebCore: WebCore::toScriptElementIfPossible + 4
         https://bugs.webkit.org/show_bug.cgi?id=144050
 

Modified: trunk/Source/WebCore/loader/cache/CachedResource.cpp (183259 => 183260)


--- trunk/Source/WebCore/loader/cache/CachedResource.cpp	2015-04-24 11:05:40 UTC (rev 183259)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp	2015-04-24 11:16:34 UTC (rev 183260)
@@ -460,7 +460,7 @@
             // We allow non-secure content to be reused in history, but we do not allow secure content to be reused.
             memoryCache.remove(*this);
         }
-        memoryCache.pruneSoon();
+        memoryCache.prune();
     }
     // This object may be dead here.
 }
@@ -557,7 +557,7 @@
             memoryCache.removeFromLiveDecodedResourcesList(*this);
             memoryCache.insertInLiveDecodedResourcesList(*this);
         }
-        memoryCache.pruneSoon();
+        memoryCache.prune();
     }
 }
     

Modified: trunk/Source/WebCore/loader/cache/MemoryCache.cpp (183259 => 183260)


--- trunk/Source/WebCore/loader/cache/MemoryCache.cpp	2015-04-24 11:05:40 UTC (rev 183259)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.cpp	2015-04-24 11:16:34 UTC (rev 183260)
@@ -69,7 +69,6 @@
     , m_deadDecodedDataDeletionInterval(defaultDecodedDataDeletionInterval)
     , m_liveSize(0)
     , m_deadSize(0)
-    , m_pruneTimer(*this, &MemoryCache::pruneTimerFired)
 {
 }
 
@@ -746,34 +745,15 @@
     ASSERT(!m_sessionResources.contains(sessionID));
 }
 
-bool MemoryCache::needsPruning() const
-{
-    return m_liveSize + m_deadSize > m_capacity || m_deadSize > m_maxDeadCapacity;
-}
-
 void MemoryCache::prune()
 {
-    if (!needsPruning())
+    if (m_liveSize + m_deadSize <= m_capacity && m_deadSize <= m_maxDeadCapacity) // Fast path.
         return;
         
     pruneDeadResources(); // Prune dead first, in case it was "borrowing" capacity from live.
     pruneLiveResources();
 }
 
-void MemoryCache::pruneTimerFired()
-{
-    prune();
-}
-
-void MemoryCache::pruneSoon()
-{
-     if (m_pruneTimer.isActive())
-        return;
-     if (!needsPruning())
-         return;
-     m_pruneTimer.startOneShot(0);
-}
-
 #ifndef NDEBUG
 void MemoryCache::dumpStats()
 {

Modified: trunk/Source/WebCore/loader/cache/MemoryCache.h (183259 => 183260)


--- trunk/Source/WebCore/loader/cache/MemoryCache.h	2015-04-24 11:05:40 UTC (rev 183259)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.h	2015-04-24 11:16:34 UTC (rev 183260)
@@ -28,7 +28,6 @@
 #include "NativeImagePtr.h"
 #include "SecurityOriginHash.h"
 #include "SessionID.h"
-#include "Timer.h"
 #include <wtf/Forward.h>
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
@@ -118,7 +117,6 @@
     WEBCORE_EXPORT void evictResources(SessionID);
     
     void prune();
-    void pruneSoon();
     unsigned size() const { return m_liveSize + m_deadSize; }
 
     void setDeadDecodedDataDeletionInterval(std::chrono::milliseconds interval) { m_deadDecodedDataDeletionInterval = interval; }
@@ -186,8 +184,6 @@
 
     unsigned liveCapacity() const;
     unsigned deadCapacity() const;
-    bool needsPruning() const;
-    void pruneTimerFired();
 
     CachedResource* resourceForRequestImpl(const ResourceRequest&, CachedResourceMap&);
 
@@ -217,8 +213,6 @@
     // referenced by a Web page).
     typedef HashMap<SessionID, std::unique_ptr<CachedResourceMap>> SessionCachedResourceMap;
     SessionCachedResourceMap m_sessionResources;
-
-    Timer m_pruneTimer;
 };
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to