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

Unified Diff: net/http/mock_http_cache.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/http/mock_http_cache.cc
diff --git a/net/http/mock_http_cache.cc b/net/http/mock_http_cache.cc
index 9fc8ced93ce4c502f56f42508b8abc454208cd9b..c7f18bf09cf348511f4349a3b3d120d566664f15 100644
--- a/net/http/mock_http_cache.cc
+++ b/net/http/mock_http_cache.cc
@@ -103,6 +103,14 @@ int32_t MockDiskEntry::GetDataSize(int index) const {
return static_cast<int32_t>(data_[index].size());
}
+int64_t MockDiskEntry::GetEntrySize() const {
+ int64_t size = key_.size();
+ for (int i = 0; i < kNumCacheEntryDataIndices; ++i) {
+ size += GetDataSize(i);
+ }
+ return size;
+}
+
int MockDiskEntry::ReadData(int index,
int offset,
IOBuffer* buf,

Powered by Google App Engine
This is Rietveld 408576698