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

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: Support null max time. Created 5 years, 3 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: 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..541681da40b7510ae19c110d1c0964de0dc60532 100644
--- a/net/disk_cache/blockfile/in_flight_backend_io.cc
+++ b/net/disk_cache/blockfile/in_flight_backend_io.cc
@@ -115,6 +115,13 @@ void BackendIO::DoomEntriesSince(const base::Time initial_time) {
initial_time_ = initial_time;
}
+void BackendIO::CalculateSizeOfEntriesBetween(const base::Time initial_time,
+ const base::Time end_time) {
+ operation_ = OP_SIZE_BETWEEN;
+ initial_time_ = initial_time;
+ end_time_ = end_time;
+}
+
void BackendIO::OpenNextEntry(Rankings::Iterator* iterator,
Entry** next_entry) {
operation_ = OP_OPEN_NEXT;
@@ -244,6 +251,10 @@ void BackendIO::ExecuteBackendOperation() {
case OP_DOOM_SINCE:
result_ = backend_->SyncDoomEntriesSince(initial_time_);
break;
+ case OP_SIZE_BETWEEN:
+ result_ = backend_->SyncCalculateSizeOfEntriesBetween(
+ initial_time_, end_time_);
+ break;
case OP_OPEN_NEXT:
result_ = backend_->SyncOpenNextEntry(iterator_, entry_ptr_);
break;
@@ -382,6 +393,15 @@ void InFlightBackendIO::DoomEntriesSince(
PostOperation(operation.get());
}
+void InFlightBackendIO::CalculateSizeOfEntriesBetween(
+ const base::Time initial_time,
+ const base::Time end_time,
+ const net::CompletionCallback& callback) {
+ scoped_refptr<BackendIO> operation(new BackendIO(this, backend_, callback));
+ operation->CalculateSizeOfEntriesBetween(initial_time, end_time);
+ PostOperation(operation.get());
+}
+
void InFlightBackendIO::OpenNextEntry(Rankings::Iterator* iterator,
Entry** next_entry,
const net::CompletionCallback& callback) {

Powered by Google App Engine
This is Rietveld 408576698