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

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

Issue 2556363003: Refactor cache counting into a separate helper class (Closed)
Patch Set: cleanup Created 4 years 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 562efdf63f2a2a155ad8a3f938a11a805726aa05..75bfe92caee8912014e5a0d7515ae86c9ed24db4 100644
--- a/net/disk_cache/blockfile/entry_impl.cc
+++ b/net/disk_cache/blockfile/entry_impl.cc
@@ -820,6 +820,14 @@ int32_t EntryImpl::GetDataSize(int index) const {
return entry->Data()->data_size[index];
}
+int64_t EntryImpl::GetEntrySize() const {
+ int64_t size = GetKey().size();
+ for (int i = 0; i < kNumStreams; ++i) {
+ size += GetDataSize(i);
+ }
+ return size;
+}
+
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