summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/disk_format.h
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 22:01:29 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 22:01:29 +0000
commit7d4e3a8bef1d62195eea2a4190a626a058bf5f23 (patch)
tree48ae233248dd5d33d8b1467c041e3fdcfcaab346 /net/disk_cache/disk_format.h
parent8d3347feb74ff61582d42b214365664ecc41c775 (diff)
downloadchromium_src-7d4e3a8bef1d62195eea2a4190a626a058bf5f23.zip
chromium_src-7d4e3a8bef1d62195eea2a4190a626a058bf5f23.tar.gz
chromium_src-7d4e3a8bef1d62195eea2a4190a626a058bf5f23.tar.bz2
Disk cache: Add explicit support for eviction / deletion
of sparse entries. I started to add code to modify the children_map of the parent entry when a child is evicted but that ended up being too much trouble for too little gain. We have to be prepared to handle the case of not finding a child entry because there is no way to make sure that the process doesn't go away at any time, so adding a lot of complexity just to avoid an extra entry lookup is just not worth it. On the other hand, potentially freeing up a lot of space when a sparse entry is deleted (insetad of just waiting for the eviction code to do the cleanup) seems like a good thing. BUG=12258 TEST=unittest Review URL: http://codereview.chromium.org/149306 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20325 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/disk_format.h')
-rw-r--r--net/disk_cache/disk_format.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/disk_cache/disk_format.h b/net/disk_cache/disk_format.h
index d1f7fed..c98fc34 100644
--- a/net/disk_cache/disk_format.h
+++ b/net/disk_cache/disk_format.h
@@ -123,7 +123,8 @@ struct EntryStore {
CacheAddr long_key; // Optional address of a long key.
int32 data_size[4]; // We can store up to 4 data streams for each
CacheAddr data_addr[4]; // entry.
- int32 pad[6];
+ uint32 flags; // Any combination of EntryFlags.
+ int32 pad[5];
char key[256 - 24 * 4]; // null terminated
};
@@ -138,6 +139,12 @@ enum EntryState {
ENTRY_DOOMED // The entry was doomed.
};
+// Flags that can be applied to an entry.
+enum EntryFlags {
+ PARENT_ENTRY = 1, // This entry has children (sparse) entries.
+ CHILD_ENTRY = 1 << 1 // Child entry that stores sparse data.
+};
+
#pragma pack(push, 4)
// Rankings information for a given entry.
struct RankingsNode {