1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "net/disk_cache/mem_rankings.h"
7 #include "base/logging.h"
8 #include "net/disk_cache/mem_entry_impl.h"
10 namespace disk_cache
{
12 MemRankings::~MemRankings() {
13 DCHECK(!head_
&& !tail_
);
16 void MemRankings::Insert(MemEntryImpl
* node
) {
18 head_
->set_prev(node
);
24 node
->set_next(head_
);
28 void MemRankings::Remove(MemEntryImpl
* node
) {
29 MemEntryImpl
* prev
= node
->prev();
30 MemEntryImpl
* next
= node
->next();
48 void MemRankings::UpdateRank(MemEntryImpl
* node
) {
53 MemEntryImpl
* MemRankings::GetNext(MemEntryImpl
* node
) {
60 MemEntryImpl
* MemRankings::GetPrev(MemEntryImpl
* node
) {
67 } // namespace disk_cache