| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // See net/disk_cache/disk_cache.h for the public interface. | 5 // See net/disk_cache/disk_cache.h for the public interface. |
| 6 | 6 |
| 7 #ifndef NET_DISK_CACHE_RANKINGS_H_ | 7 #ifndef NET_DISK_CACHE_RANKINGS_H_ |
| 8 #define NET_DISK_CACHE_RANKINGS_H_ | 8 #define NET_DISK_CACHE_RANKINGS_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 } | 86 } |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 Rankings* rankings_; | 89 Rankings* rankings_; |
| 90 DISALLOW_COPY_AND_ASSIGN(ScopedRankingsBlock); | 90 DISALLOW_COPY_AND_ASSIGN(ScopedRankingsBlock); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 // If we have multiple lists, we have to iterate through all at the same time. | 93 // If we have multiple lists, we have to iterate through all at the same time. |
| 94 // This structure keeps track of where we are on the iteration. | 94 // This structure keeps track of where we are on the iteration. |
| 95 struct Iterator { | 95 struct Iterator { |
| 96 explicit Iterator(Rankings* rankings); |
| 97 ~Iterator(); |
| 98 |
| 96 List list; // Which entry was returned to the user. | 99 List list; // Which entry was returned to the user. |
| 97 CacheRankingsBlock* nodes[3]; // Nodes on the first three lists. | 100 CacheRankingsBlock* nodes[3]; // Nodes on the first three lists. |
| 98 Rankings* my_rankings; | 101 Rankings* my_rankings; |
| 99 explicit Iterator(Rankings* rankings); | |
| 100 ~Iterator(); | |
| 101 }; | 102 }; |
| 102 | 103 |
| 103 Rankings(); | 104 Rankings(); |
| 104 ~Rankings(); | 105 ~Rankings(); |
| 105 | 106 |
| 106 bool Init(BackendImpl* backend, bool count_lists); | 107 bool Init(BackendImpl* backend, bool count_lists); |
| 107 | 108 |
| 108 // Restores original state, leaving the object ready for initialization. | 109 // Restores original state, leaving the object ready for initialization. |
| 109 void Reset(); | 110 void Reset(); |
| 110 | 111 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 BackendImpl* backend_; | 194 BackendImpl* backend_; |
| 194 LruData* control_data_; // Data related to the LRU lists. | 195 LruData* control_data_; // Data related to the LRU lists. |
| 195 IteratorList iterators_; | 196 IteratorList iterators_; |
| 196 | 197 |
| 197 DISALLOW_COPY_AND_ASSIGN(Rankings); | 198 DISALLOW_COPY_AND_ASSIGN(Rankings); |
| 198 }; | 199 }; |
| 199 | 200 |
| 200 } // namespace disk_cache | 201 } // namespace disk_cache |
| 201 | 202 |
| 202 #endif // NET_DISK_CACHE_RANKINGS_H_ | 203 #endif // NET_DISK_CACHE_RANKINGS_H_ |
| OLD | NEW |