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

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

Issue 1304363013: Add a size estimation mechanism to StoragePartitionHttpCacheDataRemover. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/entry_impl.cc
diff --git a/net/disk_cache/blockfile/entry_impl.cc b/net/disk_cache/blockfile/entry_impl.cc
index c26026e2d788a65bc9064f475b0a2289d13c69e9..9bedec4c9d19c1e7a49aa2676e07dd764a531302 100644
--- a/net/disk_cache/blockfile/entry_impl.cc
+++ b/net/disk_cache/blockfile/entry_impl.cc
@@ -808,6 +808,14 @@ int32 EntryImpl::GetDataSize(int index) const {
return entry->Data()->data_size[index];
}
+int EntryImpl::GetEntrySize() const {
+ int result = 0;
+ for (int i = 0; i < kNumStreams; ++i) {
+ result += GetDataSize(i);
+ }
+ return result;
+}
+
int EntryImpl::ReadData(int index, int offset, IOBuffer* buf, int buf_len,
const CompletionCallback& callback) {
if (callback.is_null())

Powered by Google App Engine
This is Rietveld 408576698