diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 00:37:15 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 00:37:15 +0000 |
commit | f20920fc7d56aebfd9631318c2b0d1adf36c5a9e (patch) | |
tree | 907380abc63c04e1d5a1a93713132bba9814d338 /net/disk_cache/storage_block.h | |
parent | bded84c49d2944862dd2d009919ef6a272e8c5f2 (diff) | |
download | chromium_src-f20920fc7d56aebfd9631318c2b0d1adf36c5a9e.zip chromium_src-f20920fc7d56aebfd9631318c2b0d1adf36c5a9e.tar.gz chromium_src-f20920fc7d56aebfd9631318c2b0d1adf36c5a9e.tar.bz2 |
Disk cache: Fix handling of invalid entries that are detected
when doing evictions or enumerations.
This cl fixes an issue with dirty entries being deleted
twice from disk, and improves the whole thing so that
different flavors or corrupt entries are removed
gracefully. We started deleting things twice when we
created the map of currently-open entries, because
we don't want to have dirty entries on that map, so it is
possible to have multiple EntryImpl objects that refer
to the same entry (for corrupt entries).
BUG=17474
TEST=Unittests, stress_cache.exe
Review URL: http://codereview.chromium.org/155951
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21360 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/storage_block.h')
-rw-r--r-- | net/disk_cache/storage_block.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/disk_cache/storage_block.h b/net/disk_cache/storage_block.h index 1c02756..78d51db 100644 --- a/net/disk_cache/storage_block.h +++ b/net/disk_cache/storage_block.h @@ -43,9 +43,13 @@ class StorageBlock : public FileBlock { // Allows the overide of dummy values passed on the constructor. bool LazyInit(MappedFile* file, Addr address); - // Sets the internal storage to share the momory provided by other instance. + // Sets the internal storage to share the memory provided by other instance. void SetData(T* other); + // Deletes the data, even if it was modified and not saved. This object must + // own the memory buffer (it cannot be shared). + void Discard(); + // Sets the object to lazily save the in-memory data on destruction. void set_modified(); |