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

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

Issue 2111243003: [CacheStorage] Keep deleted caches alive until last reference is gone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from PS3 Created 4 years, 5 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 | « no previous file | content/browser/cache_storage/cache_storage.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 20376c1257e2762f4ac5a66f1693f56a760fcc3a..bcc3d2a55831ececc905d4480dcbb1772a4b23be 100644
--- a/content/browser/cache_storage/cache_storage.h
+++ b/content/browser/cache_storage/cache_storage.h
@@ -77,7 +77,11 @@ class CONTENT_EXPORT CacheStorage {
const BoolAndErrorCallback& callback);
// Deletes the cache if it exists. If it doesn't exist,
- // CACHE_STORAGE_ERROR_NOT_FOUND is returned.
+ // CACHE_STORAGE_ERROR_NOT_FOUND is returned. Any existing
+ // CacheStorageCacheHandle(s) to the cache will remain valid but future
+ // CacheStorage operations won't be able to access the cache. The cache
+ // isn't actually erased from disk until the last handle is dropped.
+ // TODO(jkarlin): Rename to DoomCache.
void DeleteCache(const std::string& cache_name,
const BoolAndErrorCallback& callback);
@@ -154,19 +158,15 @@ class CONTENT_EXPORT CacheStorage {
// The DeleteCache callbacks are below.
void DeleteCacheImpl(const std::string& cache_name,
const BoolAndErrorCallback& callback);
-
- void DeleteCacheDidClose(
+ void DeleteCacheDidWriteIndex(
const std::string& cache_name,
+ const StringVector& original_ordered_cache_names,
const BoolAndErrorCallback& callback,
- const StringVector& ordered_cache_names,
- std::unique_ptr<CacheStorageCacheHandle> cache_handle,
- int64_t cache_size);
- void DeleteCacheDidWriteIndex(const std::string& cache_name,
- const BoolAndErrorCallback& callback,
- int cache_size,
- bool success);
- void DeleteCacheDidCleanUp(const BoolAndErrorCallback& callback,
- bool success);
+ bool success);
+ void DeleteCacheFinalize(std::unique_ptr<CacheStorageCache> doomed_cache);
+ void DeleteCacheDidGetSize(std::unique_ptr<CacheStorageCache> cache,
+ int64_t cache_size);
+ void DeleteCacheDidCleanUp(bool success);
// The EnumerateCache callbacks are below.
void EnumerateCachesImpl(const StringsAndErrorCallback& callback);
@@ -234,7 +234,7 @@ class CONTENT_EXPORT CacheStorage {
// Caches that have been deleted but must still be held onto until all handles
// have been released.
std::map<CacheStorageCache*, std::unique_ptr<CacheStorageCache>>
- deleted_caches_;
+ doomed_caches_;
// CacheStorageCacheHandle reference counts
std::map<CacheStorageCache*, size_t> cache_handle_counts_;
« no previous file with comments | « no previous file | content/browser/cache_storage/cache_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698