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

Unified Diff: components/browsing_data/content/storage_partition_http_cache_data_remover.h

Issue 2556363003: Refactor cache counting into a separate helper class (Closed)
Patch Set: Remove code depending on GetEntrySize() Created 3 years, 11 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: components/browsing_data/content/storage_partition_http_cache_data_remover.h
diff --git a/components/browsing_data/content/storage_partition_http_cache_data_remover.h b/components/browsing_data/content/storage_partition_http_cache_data_remover.h
index ee4d581fbb7f5451f76bfb6b3d7398978221ff11..8d11a4ffa6f36cd249340eaf5c58b12bbd287d86 100644
--- a/components/browsing_data/content/storage_partition_http_cache_data_remover.h
+++ b/components/browsing_data/content/storage_partition_http_cache_data_remover.h
@@ -51,18 +51,14 @@ class StoragePartitionHttpCacheDataRemover {
// Calls |done_callback| upon completion and also destroys itself.
void Remove(const base::Closure& done_callback);
- // Counts the total size of entries that would be removed by calling |Remove|.
- // Reports it via |result_callback| and then destroys itself.
- void Count(const net::Int64CompletionCallback& result_callback);
-
private:
enum CacheState {
- STATE_NONE,
- STATE_CREATE_MAIN,
- STATE_CREATE_MEDIA,
- STATE_PROCESS_MAIN,
- STATE_PROCESS_MEDIA,
- STATE_DONE
+ NONE,
+ CREATE_MAIN,
+ CREATE_MEDIA,
+ DELETE_MAIN,
+ DELETE_MEDIA,
+ DONE
};
StoragePartitionHttpCacheDataRemover(
@@ -80,14 +76,9 @@ class StoragePartitionHttpCacheDataRemover {
~StoragePartitionHttpCacheDataRemover();
void ClearHttpCacheOnIOThread();
- void CountHttpCacheOnIOThread();
-
void ClearedHttpCache();
- void CountedHttpCache();
-
// Performs the actual work to delete or count the cache.
void DoClearCache(int rv);
- void DoCountCache(int rv);
base::Callback<bool(const GURL&)> url_predicate_;
const base::Time delete_begin_;
@@ -97,17 +88,11 @@ class StoragePartitionHttpCacheDataRemover {
const scoped_refptr<net::URLRequestContextGetter> media_context_getter_;
base::Closure done_callback_;
- net::Int64CompletionCallback result_callback_;
// IO.
int next_cache_state_;
disk_cache::Backend* cache_;
- // Stores the cache size computation result before it can be returned
- // via a callback. This is either the sum of size of the the two cache
- // backends, or an error code if the calculation failed.
- int64_t calculation_result_;
-
DISALLOW_COPY_AND_ASSIGN(StoragePartitionHttpCacheDataRemover);
};

Powered by Google App Engine
This is Rietveld 408576698