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

Unified Diff: Source/core/fetch/MemoryCache.h

Issue 424633002: Oilpan: Prepare to move Resource to Oilpan heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: unregister -> register Created 6 years, 5 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 | « no previous file | Source/core/fetch/MemoryCache.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/MemoryCache.h
diff --git a/Source/core/fetch/MemoryCache.h b/Source/core/fetch/MemoryCache.h
index e307ec372157e7ecd839788c453aa32d87b1eb08..47f203e4e06597edaeb4a1d53243e5928747e502 100644
--- a/Source/core/fetch/MemoryCache.h
+++ b/Source/core/fetch/MemoryCache.h
@@ -197,6 +197,11 @@ public:
void makeLive(Resource*);
void makeDead(Resource*);
+ // This should be called when a Resource object is created.
+ void registerLiveResource(Resource&);
+ // This should be called when a Resource object becomes unnecesarry.
+ void unregisterLiveResource(Resource&);
+
static void removeURLFromCache(ExecutionContext*, const KURL&);
Statistics getStatistics();
@@ -274,6 +279,14 @@ private:
typedef WillBeHeapHashMap<String, OwnPtrWillBeMember<MemoryCacheEntry> > ResourceMap;
ResourceMap m_resources;
+#if ENABLE(OILPAN)
+ // Unlike m_allResources, m_liveResources is a set of Resource objects which
+ // should not be deleted. m_allResources only contains on-cache Resource
+ // objects.
+ // FIXME: Can we remove manual lifetime management of Resource and this?
+ HeapHashSet<Member<Resource> > m_liveResources;
+#endif
+
friend class MemoryCacheTest;
#ifdef MEMORY_CACHE_STATS
Timer<MemoryCache> m_statsTimer;
« no previous file with comments | « no previous file | Source/core/fetch/MemoryCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698