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

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: 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/entry_impl.cc
diff --git a/net/disk_cache/blockfile/entry_impl.cc b/net/disk_cache/blockfile/entry_impl.cc
index c26026e2d788a65bc9064f475b0a2289d13c69e9..f2cc9f1270b27d516d4e0e0117273b036b7d61d2 100644
--- a/net/disk_cache/blockfile/entry_impl.cc
+++ b/net/disk_cache/blockfile/entry_impl.cc
@@ -746,6 +746,14 @@ int EntryImpl::NumBlocksForEntry(int key_size) {
return ((key_size - key1_len) / 256 + 2);
}
+int EntryImpl::GetEntrySize() const {
+ int result = 0;
+ for (int i = 0; i < kNumStreams; ++i) {
+ result += GetDataSize(i);
+ }
+ return result;
+}
+
// ------------------------------------------------------------------------
void EntryImpl::Doom() {

Powered by Google App Engine
This is Rietveld 408576698