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_unittest.cc | |
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_unittest.cc')
-rw-r--r-- | net/disk_cache/entry_unittest.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/net/disk_cache/entry_unittest.cc b/net/disk_cache/entry_unittest.cc index a0f77ef..df5a058 100644 --- a/net/disk_cache/entry_unittest.cc +++ b/net/disk_cache/entry_unittest.cc @@ -809,6 +809,7 @@ void DiskCacheEntryTest::DoomedEntry() { EXPECT_EQ(2000, entry->WriteData(0, 0, buffer1, 2000, NULL, false)); EXPECT_EQ(2000, entry->ReadData(0, 0, buffer2, 2000, NULL)); EXPECT_EQ(0, memcmp(buffer1->data(), buffer2->data(), kSize1)); + EXPECT_EQ(key, entry->GetKey()); EXPECT_TRUE(initial < entry->GetLastModified()); EXPECT_TRUE(initial < entry->GetLastUsed()); |