diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-17 20:17:29 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-17 20:17:29 +0000 |
commit | 128369396677f4480166e12d5e14d2a578336f3f (patch) | |
tree | 088edff14c68b7ace2ab6e5123e642c1e07d7863 /net/disk_cache/disk_format.h | |
parent | 6e8401da30af0b3a4ab350bbd261b41589a568f9 (diff) | |
download | chromium_src-128369396677f4480166e12d5e14d2a578336f3f.zip chromium_src-128369396677f4480166e12d5e14d2a578336f3f.tar.gz chromium_src-128369396677f4480166e12d5e14d2a578336f3f.tar.bz2 |
Disk cache: Add support for having a sparse entry block that
is not totally filled. This is required to allow two
consecutive writes to fill a given range without caring
about the actual start offset of the second one (as long as
it is right where the first one ended).
This CL also takes care of all pending TODOs of the sparse
disk cache. Sparse disk cache support is now feature
complete.
BUG=12258
TEST=unittests
Review URL: http://codereview.chromium.org/155590
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20988 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/disk_format.h')
-rw-r--r-- | net/disk_cache/disk_format.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/disk_cache/disk_format.h b/net/disk_cache/disk_format.h index c98fc34..8f0843d 100644 --- a/net/disk_cache/disk_format.h +++ b/net/disk_cache/disk_format.h @@ -233,11 +233,16 @@ COMPILE_ASSERT(sizeof(BlockFileHeader) == kBlockHeaderSize, bad_header); // This structure contains the control information for parent and child entries. // It is stored at offset 0 of the data stream with index 2. +// It is possible to write to a child entry in a way that causes the last block +// to be only partialy filled. In that case, last_block and last_block_len will +// keep track of that block. struct SparseHeader { int64 signature; // The parent and children signature. uint32 magic; // Structure identifier (equal to kIndexMagic). int32 parent_key_len; // Key length for the parent entry. - int32 dummy[4]; + int32 last_block; // Index of the last written block. + int32 last_block_len; // Lenght of the last written block. + int32 dummy[10]; }; // The SparseHeader will be followed by a bitmap, as described by this |