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

Unified Diff: net/disk_cache/backend_impl.cc

Issue 14141: Disk cache: remove the hard coded list from rankings.cc... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years 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
« no previous file with comments | « net/disk_cache/backend_impl.h ('k') | net/disk_cache/entry_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/backend_impl.cc
===================================================================
--- net/disk_cache/backend_impl.cc (revision 6847)
+++ net/disk_cache/backend_impl.cc (working copy)
@@ -355,7 +355,7 @@
data_->header.num_entries++;
DCHECK(data_->header.num_entries > 0);
- rankings_.Insert(cache_entry->rankings(), true);
+ rankings_.Insert(cache_entry->rankings(), true, Rankings::NO_USE);
if (!parent.get())
data_->table[hash & mask_] = entry_address.value();
@@ -573,9 +573,10 @@
return &data_->header.lru;
}
-void BackendImpl::UpdateRank(CacheRankingsBlock* node, bool modified) {
- if (!read_only_)
- rankings_.UpdateRank(node, modified);
+void BackendImpl::UpdateRank(EntryImpl* entry, bool modified) {
+ if (!read_only_) {
+ rankings_.UpdateRank(entry->rankings(), modified, Rankings::NO_USE);
+ }
}
void BackendImpl::RecoveredEntry(CacheRankingsBlock* rankings) {
@@ -603,7 +604,7 @@
Trace("Doom entry 0x%p", entry);
- rankings_.Remove(entry->rankings());
+ rankings_.Remove(entry->rankings(), Rankings::NO_USE);
entry->InternalDoom();
@@ -971,8 +972,9 @@
Rankings::ScopedRankingsBlock rankings(&rankings_,
reinterpret_cast<CacheRankingsBlock*>(*iter));
- CacheRankingsBlock* next_block = forward ? rankings_.GetNext(rankings.get()) :
- rankings_.GetPrev(rankings.get());
+ CacheRankingsBlock* next_block = forward ?
+ rankings_.GetNext(rankings.get(), Rankings::NO_USE) :
+ rankings_.GetPrev(rankings.get(), Rankings::NO_USE);
Rankings::ScopedRankingsBlock next(&rankings_, next_block);
*next_entry = NULL;
*iter = NULL;
@@ -1018,7 +1020,7 @@
LOG(WARNING) << "Destroying invalid entry.";
Trace("Destroying invalid entry 0x%p", entry);
- rankings_.Remove(entry->rankings());
+ rankings_.Remove(entry->rankings(), Rankings::NO_USE);
entry->SetPointerForInvalidEntry(GetCurrentEntryId());
entry->InternalDoom();
@@ -1035,13 +1037,14 @@
Time start = Time::Now();
Rankings::ScopedRankingsBlock node(&rankings_);
- Rankings::ScopedRankingsBlock next(&rankings_, rankings_.GetPrev(node.get()));
+ Rankings::ScopedRankingsBlock next(&rankings_,
+ rankings_.GetPrev(node.get(), Rankings::NO_USE));
DCHECK(next.get());
int target_size = empty ? 0 : LowWaterAdjust(max_size_);
int deleted = 0;
while (data_->header.num_bytes > target_size && next.get()) {
node.reset(next.release());
- next.reset(rankings_.GetPrev(node.get()));
+ next.reset(rankings_.GetPrev(node.get(), Rankings::NO_USE));
if (!node->Data()->pointer || empty) {
// This entry is not being used by anybody.
EntryImpl* entry;
« no previous file with comments | « net/disk_cache/backend_impl.h ('k') | net/disk_cache/entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698