Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1075)

Unified Diff: Source/core/loader/cache/MemoryCache.h

Issue 19393004: Allow eviction of ImageBitmaps that are created from ImageElements. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix for assertion failure. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/loader/cache/CachedImageTest.cpp ('k') | Source/core/loader/cache/MemoryCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/loader/cache/MemoryCache.h
diff --git a/Source/core/loader/cache/MemoryCache.h b/Source/core/loader/cache/MemoryCache.h
index 1d7d400ce2d4ce3ba465ada4f224ed193c3091ec..eed24f67fedae0b7d2624f0e432a2fad0eface14 100644
--- a/Source/core/loader/cache/MemoryCache.h
+++ b/Source/core/loader/cache/MemoryCache.h
@@ -25,6 +25,7 @@
#ifndef Cache_h
#define Cache_h
+#include "core/loader/cache/Resource.h"
#include "wtf/HashMap.h"
#include "wtf/Noncopyable.h"
#include "wtf/Vector.h"
@@ -119,6 +120,7 @@ public:
// - maxDeadBytes: The maximum number of bytes that dead resources should consume when the cache is not under pressure.
// - totalBytes: The maximum number of bytes that the cache should consume overall.
void setCapacities(unsigned minDeadBytes, unsigned maxDeadBytes, unsigned totalBytes);
+ void setDelayBeforeLiveDecodedPrune(unsigned seconds) { m_delayBeforeLiveDecodedPrune = seconds; }
void evictResources();
@@ -173,6 +175,8 @@ private:
unsigned m_capacity;
unsigned m_minDeadCapacity;
unsigned m_maxDeadCapacity;
+ unsigned m_delayBeforeLiveDecodedPrune;
+ double m_deadDecodedDataDeletionInterval;
unsigned m_liveSize; // The number of bytes currently consumed by "live" resources in the cache.
unsigned m_deadSize; // The number of bytes currently consumed by "dead" resources in the cache.
@@ -182,8 +186,9 @@ private:
// waiting to die when the clients referencing them go away.
Vector<LRUList, 32> m_allResources;
- // List just for live resources with decoded data. Access to this list is based off of painting the resource.
- LRUList m_liveDecodedResources;
+ // Lists just for live resources with decoded data. Access to this list is based off of painting the resource.
+ // The lists are ordered by decode priority, with higher indices having higher priorities.
+ LRUList m_liveDecodedResources[Resource::CacheLiveResourcePriorityHigh + 1];
// A URL-based map of all resources that are in the cache (including the freshest version of objects that are currently being
// referenced by a Web page).
« no previous file with comments | « Source/core/loader/cache/CachedImageTest.cpp ('k') | Source/core/loader/cache/MemoryCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698