diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 22:01:29 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-09 22:01:29 +0000 |
commit | 7d4e3a8bef1d62195eea2a4190a626a058bf5f23 (patch) | |
tree | 48ae233248dd5d33d8b1467c041e3fdcfcaab346 /net/disk_cache/sparse_control.h | |
parent | 8d3347feb74ff61582d42b214365664ecc41c775 (diff) | |
download | chromium_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/sparse_control.h')
-rw-r--r-- | net/disk_cache/sparse_control.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/disk_cache/sparse_control.h b/net/disk_cache/sparse_control.h index 0c696ea..c93e5e4 100644 --- a/net/disk_cache/sparse_control.h +++ b/net/disk_cache/sparse_control.h @@ -63,6 +63,9 @@ class SparseControl { // Implements Entry::GetAvailableRange(). int GetAvailableRange(int64 offset, int len, int64* start); + // Deletes the children entries of |entry|. + static void DeleteChildren(EntryImpl* entry); + private: // Creates a new sparse entry or opens an aready created entry from disk. // These methods just read / write the required info from disk for the current |