Chromium Code Reviews| Index: content/browser/cache_storage/cache_storage_dispatcher_host.h |
| diff --git a/content/browser/cache_storage/cache_storage_dispatcher_host.h b/content/browser/cache_storage/cache_storage_dispatcher_host.h |
| index d937bac03486e5343e5a002e939dcf5575774754..f3dce4ffe834d876b1517e03a7788ac1aeb8d117 100644 |
| --- a/content/browser/cache_storage/cache_storage_dispatcher_host.h |
| +++ b/content/browser/cache_storage/cache_storage_dispatcher_host.h |
| @@ -155,6 +155,8 @@ class CONTENT_EXPORT CacheStorageDispatcherHost : public BrowserMessageFilter { |
| std::unique_ptr<CacheStorageCacheHandle> cache_handle, |
| CacheStorageError error); |
| + void StopPreservingCache(const CacheStorageCache* cache); |
| + |
| // Hangs onto a cache handle. Returns a unique cache_id. Call |
| // DropCacheReference when the reference is no longer needed. |
| CacheID StoreCacheReference( |
| @@ -166,6 +168,11 @@ class CONTENT_EXPORT CacheStorageDispatcherHost : public BrowserMessageFilter { |
| void StoreBlobDataHandle(const storage::BlobDataHandle& blob_data_handle); |
| void DropBlobDataHandle(const std::string& uuid); |
| + // Store handles to recently opened caches for a short period in case they're |
| + // used again in the near future. |
| + std::map<const CacheStorageCache*, std::unique_ptr<CacheStorageCacheHandle>> |
| + preserved_cache_handles_; |
| + |
| IDToCacheMap id_to_cache_map_; |
| CacheID next_cache_id_ = 0; |
| @@ -173,6 +180,8 @@ class CONTENT_EXPORT CacheStorageDispatcherHost : public BrowserMessageFilter { |
| scoped_refptr<CacheStorageContextImpl> context_; |
| + base::WeakPtrFactory<CacheStorageDispatcherHost> weak_ptr_factory_; |
|
nhiroki
2016/06/28 06:22:34
Is this usage of WeakPtrFactory safe?
According t
jkarlin
2016/06/28 11:20:14
Thanks, and good point. Fixed.
|
| + |
| DISALLOW_COPY_AND_ASSIGN(CacheStorageDispatcherHost); |
| }; |