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

Unified Diff: net/disk_cache/simple/simple_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: Missed some spots again. 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/simple/simple_entry_impl.cc
diff --git a/net/disk_cache/simple/simple_entry_impl.cc b/net/disk_cache/simple/simple_entry_impl.cc
index 391079276067eb4605be4dc29b6b72d0d401d6a3..2587f91aa0a2ef68d7ce1f465121f27d5917dc9b 100644
--- a/net/disk_cache/simple/simple_entry_impl.cc
+++ b/net/disk_cache/simple/simple_entry_impl.cc
@@ -339,6 +339,14 @@ int32 SimpleEntryImpl::GetDataSize(int stream_index) const {
return data_size_[stream_index];
}
+int SimpleEntryImpl::GetEntrySize() const {
+ DCHECK(io_thread_checker_.CalledOnValidThread());
+ int result = 0;
+ for (int i = 0; i < kSimpleEntryStreamCount; ++i)
+ result += GetDataSize(i);
+ return result;
+}
+
int SimpleEntryImpl::ReadData(int stream_index,
int offset,
net::IOBuffer* buf,

Powered by Google App Engine
This is Rietveld 408576698