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

Unified Diff: net/disk_cache/mem_rankings.cc

Issue 121643003: Reorganize net/disk_cache into backend specific directories. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: #define fixes Created 6 years, 10 months 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/mem_rankings.cc
diff --git a/net/disk_cache/mem_rankings.cc b/net/disk_cache/mem_rankings.cc
deleted file mode 100644
index d5f4a6536a792f48df0998d6e7a9a603b3577aa9..0000000000000000000000000000000000000000
--- a/net/disk_cache/mem_rankings.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/disk_cache/mem_rankings.h"
-
-#include "base/logging.h"
-#include "net/disk_cache/mem_entry_impl.h"
-
-namespace disk_cache {
-
-MemRankings::~MemRankings() {
- DCHECK(!head_ && !tail_);
-}
-
-void MemRankings::Insert(MemEntryImpl* node) {
- if (head_)
- head_->set_prev(node);
-
- if (!tail_)
- tail_ = node;
-
- node->set_prev(NULL);
- node->set_next(head_);
- head_ = node;
-}
-
-void MemRankings::Remove(MemEntryImpl* node) {
- MemEntryImpl* prev = node->prev();
- MemEntryImpl* next = node->next();
-
- if (head_ == node)
- head_ = next;
-
- if (tail_ == node)
- tail_ = prev;
-
- if (prev)
- prev->set_next(next);
-
- if (next)
- next->set_prev(prev);
-
- node->set_next(NULL);
- node->set_prev(NULL);
-}
-
-void MemRankings::UpdateRank(MemEntryImpl* node) {
- Remove(node);
- Insert(node);
-}
-
-MemEntryImpl* MemRankings::GetNext(MemEntryImpl* node) {
- if (!node)
- return head_;
-
- return node->next();
-}
-
-MemEntryImpl* MemRankings::GetPrev(MemEntryImpl* node) {
- if (!node)
- return tail_;
-
- return node->prev();
-}
-
-} // namespace disk_cache

Powered by Google App Engine
This is Rietveld 408576698