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

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

Issue 640463003: MemoryCache: Enable MemoryCache to have multiple isolated resource maps (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remake Created 6 years, 2 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
Index: Source/core/fetch/MemoryCache.h
diff --git a/Source/core/fetch/MemoryCache.h b/Source/core/fetch/MemoryCache.h
index 16ff2a12a37fa3d6bcca84ff7dc70aa24ebe7d9c..4c43802cdf98ad8ee2544b0fe8c46ee8fe7bd790 100644
--- a/Source/core/fetch/MemoryCache.h
+++ b/Source/core/fetch/MemoryCache.h
@@ -169,7 +169,8 @@ public:
TypeStatistic other;
};
- Resource* resourceForURL(const KURL&);
+ Resource* resourceForURL(const String& cacheIdentifier, const KURL&);
Mike West 2014/10/24 12:43:00 If you make |cacheIdentifier| the second argument,
nhiroki 2014/10/27 14:30:13 Done.
+ WillBeHeapVector<Member<Resource>> resourcesForURL(const KURL&);
void add(Resource*);
void replace(Resource* newResource, Resource* oldResource);
@@ -178,6 +179,8 @@ public:
static KURL removeFragmentIdentifierIfNeeded(const KURL& originalURL);
+ static String defaultCacheIdentifier();
+
// Sets the cache's memory capacities, in bytes. These will hold only approximately,
// since the decoded cost of resources like scripts and stylesheets is not known.
// - minDeadBytes: The maximum number of bytes that dead resources should consume when the cache is under pressure.
@@ -252,6 +255,8 @@ private:
bool evict(MemoryCacheEntry*);
+ MemoryCacheEntry* getEntryForResource(const Resource*) const;
+
static void removeURLFromCacheInternal(ExecutionContext*, const KURL&);
bool m_inPruneResources;
@@ -281,7 +286,9 @@ private:
// 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).
typedef WillBeHeapHashMap<String, OwnPtrWillBeMember<MemoryCacheEntry>> ResourceMap;
- ResourceMap m_resources;
+ typedef WillBeHeapHashMap<String, OwnPtrWillBeMember<ResourceMap>> ResourceMapIndex;
Mike West 2014/10/24 12:43:00 Nit: These should be converted to the new `using`
nhiroki 2014/10/27 14:30:13 Done.
+ ResourceMap* getResourceMap(const String& cacheIdentifier);
+ ResourceMapIndex m_resources;
Mike West 2014/10/24 12:43:00 Nit: Perhaps `m_resourceMaps`, now?
nhiroki 2014/10/27 14:30:13 Done.
#if ENABLE(OILPAN)
// Unlike m_allResources, m_liveResources is a set of Resource objects which

Powered by Google App Engine
This is Rietveld 408576698