| Index: content/browser/cache_storage/cache_storage.h
|
| diff --git a/content/browser/cache_storage/cache_storage.h b/content/browser/cache_storage/cache_storage.h
|
| index 6ec3e238dd05bfe52c16906b4fb3a5833b5a5476..b2ea3876ca059e0fbd268d20154067094ce34332 100644
|
| --- a/content/browser/cache_storage/cache_storage.h
|
| +++ b/content/browser/cache_storage/cache_storage.h
|
| @@ -102,6 +102,8 @@ class CONTENT_EXPORT CacheStorage {
|
| void CompleteAsyncOperationForTesting();
|
|
|
| private:
|
| + friend class TestCacheStorage;
|
| +
|
| class MemoryLoader;
|
| class SimpleCacheLoader;
|
| class CacheLoader;
|
| @@ -113,6 +115,12 @@ class CONTENT_EXPORT CacheStorage {
|
| scoped_refptr<CacheStorageCache> GetLoadedCache(
|
| const std::string& cache_name);
|
|
|
| + // Holds a reference to a cache for thirty seconds.
|
| + void TemporarilyPreserveCache(const scoped_refptr<CacheStorageCache>& cache);
|
| + virtual void SchedulePreservedCacheRemoval(
|
| + const base::Closure& callback); // Virtual for testing.
|
| + void RemovePreservedCache(const CacheStorageCache* cache);
|
| +
|
| // Initializer and its callback are below.
|
| void LazyInit();
|
| void LazyInitImpl();
|
| @@ -217,6 +225,11 @@ class CONTENT_EXPORT CacheStorage {
|
| // Performs backend specific operations (memory vs disk).
|
| scoped_ptr<CacheLoader> cache_loader_;
|
|
|
| + // Holds ref pointers to recently opened caches so that they can be reused
|
| + // without having the open the cache again.
|
| + std::map<const CacheStorageCache*, scoped_refptr<CacheStorageCache>>
|
| + preserved_caches_;
|
| +
|
| base::WeakPtrFactory<CacheStorage> weak_factory_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(CacheStorage);
|
|
|