Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(838)

Unified Diff: net/disk_cache/backend_impl.cc

Issue 8658001: Disk cache: Add a hash to the entry's internal data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/disk_cache/backend_impl.cc
===================================================================
--- net/disk_cache/backend_impl.cc (revision 110637)
+++ net/disk_cache/backend_impl.cc (working copy)
@@ -819,8 +819,8 @@
open_entries_[entry_address.value()] = cache_entry;
// Save the entry.
- block_files_.GetFile(entry_address)->Store(cache_entry->entry());
- block_files_.GetFile(node_address)->Store(cache_entry->rankings());
+ cache_entry->entry()->Store();
+ cache_entry->rankings()->Store();
gavinp 2011/11/29 15:47:42 Nice.
IncreaseNumEntries();
entry_count_++;
@@ -1643,9 +1643,6 @@
if (!cache_entry->LoadNodeAddress())
return ERR_READ_FAILURE;
- // Prevent overwriting the dirty flag on the destructor.
- cache_entry->SetDirtyFlag(GetCurrentEntryId());
-
if (!rankings_.SanityCheck(cache_entry->rankings(), false)) {
STRESS_NOTREACHED();
cache_entry->SetDirtyFlag(0);
@@ -1665,6 +1662,9 @@
cache_entry->FixForDelete();
}
+ // Prevent overwriting the dirty flag on the destructor.
+ cache_entry->SetDirtyFlag(GetCurrentEntryId());
gavinp 2011/11/29 15:47:42 Why is this moving beyond the two sanity-check blo
rvargas (doing something else) 2011/11/29 19:08:56 Because this is reading Rankings; we want the firs
+
if (cache_entry->dirty()) {
Trace("Dirty entry 0x%p 0x%x", reinterpret_cast<void*>(cache_entry.get()),
address.value());
@@ -2219,8 +2219,7 @@
}
}
- RankingsNode* rankings = cache_entry->rankings()->Data();
- return ok && !rankings->dummy;
+ return ok && cache_entry->rankings()->VerifyHash();
}
int BackendImpl::MaxBuffersSize() {

Powered by Google App Engine
This is Rietveld 408576698