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

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: tweak variable names 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
« no previous file with comments | « LayoutTests/http/tests/serviceworker/chromium/memory-cache.html ('k') | 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 16ff2a12a37fa3d6bcca84ff7dc70aa24ebe7d9c..70825547d3b88a3e78133df5d42f46864546c458 100644
--- a/Source/core/fetch/MemoryCache.h
+++ b/Source/core/fetch/MemoryCache.h
@@ -170,6 +170,8 @@ public:
};
Resource* resourceForURL(const KURL&);
+ Resource* resourceForURL(const KURL&, const String& cacheIdentifier);
+ WillBeHeapVector<Member<Resource>> resourcesForURL(const KURL&);
void add(Resource*);
void replace(Resource* newResource, Resource* oldResource);
@@ -178,6 +180,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 +256,8 @@ private:
bool evict(MemoryCacheEntry*);
+ MemoryCacheEntry* getEntryForResource(const Resource*) const;
+
static void removeURLFromCacheInternal(ExecutionContext*, const KURL&);
bool m_inPruneResources;
@@ -280,8 +286,10 @@ 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;
+ using ResourceMap = WillBeHeapHashMap<String, OwnPtrWillBeMember<MemoryCacheEntry>>;
+ using ResourceMapIndex = WillBeHeapHashMap<String, OwnPtrWillBeMember<ResourceMap>>;
+ ResourceMap* ensureResourceMap(const String& cacheIdentifier);
+ ResourceMapIndex m_resourceMaps;
#if ENABLE(OILPAN)
// Unlike m_allResources, m_liveResources is a set of Resource objects which
« no previous file with comments | « LayoutTests/http/tests/serviceworker/chromium/memory-cache.html ('k') | Source/core/fetch/MemoryCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698