Title: [183213] trunk/Source/WebCore
Revision
183213
Author
[email protected]
Date
2015-04-23 14:58:48 -0700 (Thu, 23 Apr 2015)

Log Message

Unreviewed, rolling out r183194.
https://bugs.webkit.org/show_bug.cgi?id=144121

Made multiple tests flaky (Requested by ap_ on #webkit).

Reverted changeset:

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (183212 => 183213)


--- trunk/Source/WebCore/ChangeLog	2015-04-23 21:56:23 UTC (rev 183212)
+++ trunk/Source/WebCore/ChangeLog	2015-04-23 21:58:48 UTC (rev 183213)
@@ -1,3 +1,17 @@
+2015-04-23  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r183194.
+        https://bugs.webkit.org/show_bug.cgi?id=144121
+
+        Made multiple tests flaky (Requested by ap_ on #webkit).
+
+        Reverted changeset:
+
+        "Memory cache live resources repeatedly purged during
+        painting"
+        https://bugs.webkit.org/show_bug.cgi?id=144104
+        http://trac.webkit.org/changeset/183194
+
 2015-04-23  Roger Fong  <[email protected]>
 
         Unreviewed. Missed a button in r182900.

Modified: trunk/Source/WebCore/loader/cache/CachedResource.cpp (183212 => 183213)


--- trunk/Source/WebCore/loader/cache/CachedResource.cpp	2015-04-23 21:56:23 UTC (rev 183212)
+++ trunk/Source/WebCore/loader/cache/CachedResource.cpp	2015-04-23 21:58:48 UTC (rev 183213)
@@ -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 (183212 => 183213)


--- trunk/Source/WebCore/loader/cache/MemoryCache.cpp	2015-04-23 21:56:23 UTC (rev 183212)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.cpp	2015-04-23 21:58:48 UTC (rev 183213)
@@ -43,7 +43,6 @@
 #include <wtf/CurrentTime.h>
 #include <wtf/MathExtras.h>
 #include <wtf/NeverDestroyed.h>
-#include <wtf/RunLoop.h>
 #include <wtf/TemporaryChange.h>
 #include <wtf/text/CString.h>
 
@@ -51,7 +50,7 @@
 
 static const int cDefaultCacheCapacity = 8192 * 1024;
 static const double cMinDelayBeforeLiveDecodedPrune = 1; // Seconds.
-static const float cTargetPrunePercentage = 0.8; // Percentage of capacity toward which we prune, to avoid immediately pruning again.
+static const float cTargetPrunePercentage = .95f; // Percentage of capacity toward which we prune, to avoid immediately pruning again.
 static const auto defaultDecodedDataDeletionInterval = std::chrono::seconds { 0 };
 
 MemoryCache& MemoryCache::singleton()
@@ -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::pruneSoon()
-{
-    if (m_willPruneSoon)
-        return;
-    if (!needsPruning())
-        return;
-
-    m_willPruneSoon = true;
-    RunLoop::main().dispatch([this] {
-        prune();
-        m_willPruneSoon = false;
-    });
-}
-
 #ifndef NDEBUG
 void MemoryCache::dumpStats()
 {

Modified: trunk/Source/WebCore/loader/cache/MemoryCache.h (183212 => 183213)


--- trunk/Source/WebCore/loader/cache/MemoryCache.h	2015-04-23 21:56:23 UTC (rev 183212)
+++ trunk/Source/WebCore/loader/cache/MemoryCache.h	2015-04-23 21:58:48 UTC (rev 183213)
@@ -115,9 +115,8 @@
 
     WEBCORE_EXPORT void evictResources();
     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; }
@@ -185,7 +184,6 @@
 
     unsigned liveCapacity() const;
     unsigned deadCapacity() const;
-    bool needsPruning() const;
 
     CachedResource* resourceForRequestImpl(const ResourceRequest&, CachedResourceMap&);
 
@@ -215,8 +213,6 @@
     // referenced by a Web page).
     typedef HashMap<SessionID, std::unique_ptr<CachedResourceMap>> SessionCachedResourceMap;
     SessionCachedResourceMap m_sessionResources;
-
-    bool m_willPruneSoon { false };
 };
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to