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

Unified Diff: net/disk_cache/blockfile/in_flight_backend_io.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/in_flight_backend_io.h ('k') | net/disk_cache/disk_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/blockfile/in_flight_backend_io.cc
diff --git a/net/disk_cache/blockfile/in_flight_backend_io.cc b/net/disk_cache/blockfile/in_flight_backend_io.cc
index 28d7114ba610313a76a4878a3d1460f2c1cacd64..b7fa8a455f147a486e8580bac40e6d7fa24336ba 100644
--- a/net/disk_cache/blockfile/in_flight_backend_io.cc
+++ b/net/disk_cache/blockfile/in_flight_backend_io.cc
@@ -115,6 +115,10 @@ void BackendIO::DoomEntriesSince(const base::Time initial_time) {
initial_time_ = initial_time;
}
+void BackendIO::CalculateSizeOfAllEntries() {
+ operation_ = OP_SIZE_ALL;
+}
+
void BackendIO::OpenNextEntry(Rankings::Iterator* iterator,
Entry** next_entry) {
operation_ = OP_OPEN_NEXT;
@@ -244,6 +248,9 @@ void BackendIO::ExecuteBackendOperation() {
case OP_DOOM_SINCE:
result_ = backend_->SyncDoomEntriesSince(initial_time_);
break;
+ case OP_SIZE_ALL:
+ result_ = backend_->SyncCalculateSizeOfAllEntries();
+ break;
case OP_OPEN_NEXT:
result_ = backend_->SyncOpenNextEntry(iterator_, entry_ptr_);
break;
@@ -375,6 +382,13 @@ void InFlightBackendIO::DoomEntriesBetween(const base::Time initial_time,
PostOperation(operation.get());
}
+void InFlightBackendIO::CalculateSizeOfAllEntries(
+ const net::CompletionCallback& callback) {
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
+ operation->CalculateSizeOfAllEntries();
+ PostOperation(operation.get());
+}
+
void InFlightBackendIO::DoomEntriesSince(
const base::Time initial_time, const net::CompletionCallback& callback) {
scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
« no previous file with comments | « net/disk_cache/blockfile/in_flight_backend_io.h ('k') | net/disk_cache/disk_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698