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

Unified Diff: net/disk_cache/blockfile/backend_impl.cc

Issue 1304363013: Add a size estimation mechanism to StoragePartitionHttpCacheDataRemover. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: static_cast Created 5 years, 2 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 | « net/disk_cache/blockfile/backend_impl.h ('k') | net/disk_cache/blockfile/backend_impl_v3.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/blockfile/backend_impl.cc
diff --git a/net/disk_cache/blockfile/backend_impl.cc b/net/disk_cache/blockfile/backend_impl.cc
index 82a58b36b6d1f37c45e5b326554a835ea50c7b64..97f35208a8a2c1ec50ac2846501a65a0d821ed29 100644
--- a/net/disk_cache/blockfile/backend_impl.cc
+++ b/net/disk_cache/blockfile/backend_impl.cc
@@ -410,6 +410,14 @@ int BackendImpl::SyncDoomEntriesBetween(const base::Time initial_time,
return net::OK;
}
+int BackendImpl::SyncCalculateSizeOfAllEntries() {
+ DCHECK_NE(net::APP_CACHE, cache_type_);
+ if (disabled_)
+ return net::ERR_FAILED;
+
+ return data_->header.num_bytes;
+}
+
// We use OpenNextEntryImpl to retrieve elements from the cache, until we get
// entries that are too old.
int BackendImpl::SyncDoomEntriesSince(const base::Time initial_time) {
@@ -1254,6 +1262,12 @@ int BackendImpl::DoomEntriesSince(const base::Time initial_time,
return net::ERR_IO_PENDING;
}
+int BackendImpl::CalculateSizeOfAllEntries(const CompletionCallback& callback) {
+ DCHECK(!callback.is_null());
+ background_queue_.CalculateSizeOfAllEntries(callback);
+ return net::ERR_IO_PENDING;
+}
+
class BackendImpl::IteratorImpl : public Backend::Iterator {
public:
explicit IteratorImpl(base::WeakPtr<InFlightBackendIO> background_queue)
« no previous file with comments | « net/disk_cache/blockfile/backend_impl.h ('k') | net/disk_cache/blockfile/backend_impl_v3.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698