diff options
author | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-06 18:48:37 +0000 |
---|---|---|
committer | rvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-06 18:48:37 +0000 |
commit | 0bcd33eacb640e709f36abf3f8d3e88ecd34efef (patch) | |
tree | c389c0f7763648e1241f457e8af4980901cc85c1 /net/disk_cache/entry_impl.h | |
parent | a0f200ea6032c2a1aa05f53482b1f272234339f1 (diff) | |
download | chromium_src-0bcd33eacb640e709f36abf3f8d3e88ecd34efef.zip chromium_src-0bcd33eacb640e709f36abf3f8d3e88ecd34efef.tar.gz chromium_src-0bcd33eacb640e709f36abf3f8d3e88ecd34efef.tar.bz2 |
Disk Cache: Don't depend on the backend being enabled to
be able to return the key of an open entry.
Whenever a critical corruption is detected by the disk cache,
the backend disables itself and starts failing all requests
until it's able to re-create the backing store.
Key's longer than 928 bytes are not stored inside the entry
itself, so a file object is required to access them. The backend
will reject any request for a file object after it is disabled,
so a user's request for the key of an open entry will also
fail.
Now we keep a pointer to the related file object (if needed) so
that we don't have to ask the backend for it when the user
requests the current key.
BUG=9952
TEST=unittest
Review URL: http://codereview.chromium.org/165030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22637 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/entry_impl.h')
-rw-r--r-- | net/disk_cache/entry_impl.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/disk_cache/entry_impl.h b/net/disk_cache/entry_impl.h index da82396..4bb4d04 100644 --- a/net/disk_cache/entry_impl.h +++ b/net/disk_cache/entry_impl.h @@ -176,8 +176,10 @@ class EntryImpl : public Entry, public base::RefCounted<EntryImpl> { CacheRankingsBlock node_; // Rankings related information for this entry. BackendImpl* backend_; // Back pointer to the cache. scoped_array<char> user_buffers_[kNumStreams]; // Store user data. - scoped_refptr<File> files_[kNumStreams + 1]; // Files to store external - // user data and key. + // Files to store external user data and key. + scoped_refptr<File> files_[kNumStreams + 1]; + // Copy of the file used to store the key. We don't own this object. + mutable File* key_file_; int unreported_size_[kNumStreams]; // Bytes not reported yet to the backend. bool doomed_; // True if this entry was removed from the cache. scoped_ptr<SparseControl> sparse_; // Support for sparse entries. |