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

Unified Diff: net/disk_cache/simple/simple_entry_impl.cc

Issue 13913010: Add Cache size to the Simple Index. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixing the branching issue Created 7 years, 8 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 d817cdeda3d22ca3e093e643e9bb0c373a8149c0..cb393cbec5ce088d23d3e8687e2349d7509afd0b 100644
--- a/net/disk_cache/simple/simple_entry_impl.cc
+++ b/net/disk_cache/simple/simple_entry_impl.cc
@@ -270,6 +270,10 @@ void SimpleEntryImpl::EntryOperationComplete(
// |entry| must have had Close() called while this operation was in flight.
// Since the simple cache now only supports one pending entry operation in
// flight at a time, it's safe to now call Close() on |sync_entry|.
+
+ // TODO(felipeg): In this case, how do update the entry size in the total
+ // cache size ?
gavinp 2013/04/09 15:27:37 sync_entry->data_size(i) still works at this point
felipeg 2013/04/09 16:24:35 Done.
+
WorkerPool::PostTask(FROM_HERE,
base::Bind(&SimpleSynchronousEntry::Close,
base::Unretained(sync_entry)),
@@ -286,8 +290,12 @@ void SimpleEntryImpl::SetSynchronousData() {
// filesystems not being accurate.
last_used_ = synchronous_entry_->last_used();
last_modified_ = synchronous_entry_->last_modified();
- for (int i = 0; i < kSimpleEntryFileCount; ++i)
+ uint64 total_entry_size = 0;
+ for (int i = 0; i < kSimpleEntryFileCount; ++i) {
data_size_[i] = synchronous_entry_->data_size(i);
+ total_entry_size += data_size_[i];
gavinp 2013/04/09 15:40:19 Maybe add SimpleSynchronousEntry::GetFileSize()?
felipeg 2013/04/09 16:24:35 Done.
+ }
+ index_->UpdateEntrySize(key_, total_entry_size);
}
} // namespace disk_cache

Powered by Google App Engine
This is Rietveld 408576698