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

Unified Diff: net/disk_cache/simple/simple_disk_format.h

Issue 13913010: Add Cache size to the Simple Index. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: syncing 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
« no previous file with comments | « no previous file | net/disk_cache/simple/simple_disk_format.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_disk_format.h
diff --git a/net/disk_cache/simple/simple_disk_format.h b/net/disk_cache/simple/simple_disk_format.h
index a48b78fde59efa0208f9ef0431ddcb7912367540..18dfe9661ad00402c6407254dc58e831d4e48e33 100644
--- a/net/disk_cache/simple/simple_disk_format.h
+++ b/net/disk_cache/simple/simple_disk_format.h
@@ -56,12 +56,15 @@ namespace SimpleIndexFile {
uint64 initial_magic_number;
uint32 version;
uint64 number_of_entries;
+ uint64 cache_size; // Total cache storage size in bytes.
};
// We must keep this struct a POD.
struct EntryMetadata {
EntryMetadata();
- EntryMetadata(const std::string& hash_key_p, base::Time last_used_time_p);
+ EntryMetadata(const std::string& hash_key_p,
+ base::Time last_used_time_p,
+ uint64 entry_size_p);
base::Time GetLastUsedTime() const;
std::string GetHashKey() const;
@@ -79,6 +82,8 @@ namespace SimpleIndexFile {
// If you want to make calculations/comparisons, you should use the
// base::Time() class. Use the GetLastUsedTime() method above.
int64 last_used_time;
+
+ uint64 entry_size; // Storage size in bytes.
};
const size_t kEntryMetadataSize = sizeof(EntryMetadata);
« no previous file with comments | « no previous file | net/disk_cache/simple/simple_disk_format.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698