Chromium Code Reviews| 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() { |