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

Unified Diff: content/browser/cache_storage/cache_storage_dispatcher_host.h

Issue 2100433003: [CacheStorage] Temporarily preserve recently opened caches from CacheStorageDispatcherHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Created 4 years, 6 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: 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);
};
« no previous file with comments | « content/browser/cache_storage/cache_storage.cc ('k') | content/browser/cache_storage/cache_storage_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698