Home | History | Annotate | Download | only in disk_cache

Lines Matching refs:Rankings

5 #include "net/disk_cache/rankings.h"
26 // This class provides a simple lock for the LRU list of rankings. Whenever an
193 Rankings::Iterator::Iterator(Rankings* rankings) {
195 my_rankings = rankings;
198 Rankings::Iterator::~Iterator() {
203 Rankings::Rankings() : init_(false) {}
205 Rankings::~Rankings() {}
207 bool Rankings::Init(BackendImpl* backend, bool count_lists) {
226 void Rankings::Reset() {
235 void Rankings::Insert(CacheRankingsBlock* node, bool modified, List list) {
305 void Rankings::Remove(CacheRankingsBlock* node, List list, bool strict) {
317 LOG(ERROR) << "Invalid rankings info.";
386 void Rankings::UpdateRank(CacheRankingsBlock* node, bool modified, List list) {
400 CacheRankingsBlock* Rankings::GetNext(CacheRankingsBlock* node, List list) {
433 CacheRankingsBlock* Rankings::GetPrev(CacheRankingsBlock* node, List list) {
466 void Rankings::FreeRankingsBlock(CacheRankingsBlock* node) {
470 void Rankings::TrackRankingsBlock(CacheRankingsBlock* node,
483 int Rankings::SelfCheck() {
494 bool Rankings::SanityCheck(CacheRankingsBlock* node, bool from_list) const {
516 if (!next_addr.SanityCheck() || next_addr.file_type() != RANKINGS ||
517 !prev_addr.SanityCheck() || prev_addr.file_type() != RANKINGS)
523 bool Rankings::DataSanityCheck(CacheRankingsBlock* node, bool from_list) const {
535 void Rankings::SetContents(CacheRankingsBlock* node, CacheAddr address) {
540 void Rankings::ReadHeads() {
545 void Rankings::ReadTails() {
550 void Rankings::WriteHead(List list) {
554 void Rankings::WriteTail(List list) {
558 bool Rankings::GetRanking(CacheRankingsBlock* rankings) {
559 if (!rankings->address().is_initialized())
563 if (!rankings->Load())
566 if (!SanityCheck(rankings, true)) {
574 if (!rankings->Data()->dirty && !rankings->Data()->dummy)
577 EntryImpl* entry = backend_->GetOpenEntry(rankings);
583 rankings->Data()->dummy = 0;
584 rankings->Data()->dirty = backend_->GetCurrentEntryId() - 1;
585 if (!rankings->Data()->dirty)
586 rankings->Data()->dirty--;
590 // Note that we should not leave this module without deleting rankings first.
591 rankings->SetData(entry->rankings()->Data());
597 void Rankings::ConvertToLongLived(CacheRankingsBlock* rankings) {
598 if (rankings->own_data())
605 *temp.Data() = *rankings->Data();
606 rankings->StopSharingData();
607 *rankings->Data() = *temp.Data();
610 void Rankings::CompleteTransaction() {
614 LOG(ERROR) << "Invalid rankings info.";
645 void Rankings::FinishInsert(CacheRankingsBlock* node) {
663 void Rankings::RevertRemove(CacheRankingsBlock* node) {
673 LOG(WARNING) << "Invalid rankings info.";
720 bool Rankings::CheckEntry(CacheRankingsBlock* rankings) {
721 if (!rankings->Data()->dummy)
725 return backend_->GetCurrentEntryId() != rankings->Data()->dirty;
728 bool Rankings::CheckLinks(CacheRankingsBlock* node, CacheRankingsBlock* prev,
767 bool Rankings::CheckSingleLink(CacheRankingsBlock* prev,
780 int Rankings::CheckList(List list) {
821 bool Rankings::IsHead(CacheAddr addr, List* list) const {
833 bool Rankings::IsTail(CacheAddr addr, List* list) const {
848 void Rankings::UpdateIterators(CacheRankingsBlock* node) {
859 void Rankings::InvalidateIterators(CacheRankingsBlock* node) {
874 void Rankings::IncrementCounter(List list) {
883 void Rankings::DecrementCounter(List list) {