OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 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 | 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 #include "net/disk_cache/backend_impl.h" | 5 #include "net/disk_cache/backend_impl.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/histogram.h" | 8 #include "base/histogram.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 533 |
534 bool BackendImpl::CreateBlock(FileType block_type, int block_count, | 534 bool BackendImpl::CreateBlock(FileType block_type, int block_count, |
535 Addr* block_address) { | 535 Addr* block_address) { |
536 return block_files_.CreateBlock(block_type, block_count, block_address); | 536 return block_files_.CreateBlock(block_type, block_count, block_address); |
537 } | 537 } |
538 | 538 |
539 void BackendImpl::DeleteBlock(Addr block_address, bool deep) { | 539 void BackendImpl::DeleteBlock(Addr block_address, bool deep) { |
540 block_files_.DeleteBlock(block_address, deep); | 540 block_files_.DeleteBlock(block_address, deep); |
541 } | 541 } |
542 | 542 |
| 543 LruData* BackendImpl::GetLruData() { |
| 544 return &data_->header.lru; |
| 545 } |
| 546 |
543 void BackendImpl::UpdateRank(CacheRankingsBlock* node, bool modified) { | 547 void BackendImpl::UpdateRank(CacheRankingsBlock* node, bool modified) { |
544 if (!read_only_) | 548 if (!read_only_) |
545 rankings_.UpdateRank(node, modified); | 549 rankings_.UpdateRank(node, modified); |
546 } | 550 } |
547 | 551 |
548 void BackendImpl::RecoveredEntry(CacheRankingsBlock* rankings) { | 552 void BackendImpl::RecoveredEntry(CacheRankingsBlock* rankings) { |
549 Addr address(rankings->Data()->contents); | 553 Addr address(rankings->Data()->contents); |
550 EntryImpl* cache_entry = NULL; | 554 EntryImpl* cache_entry = NULL; |
551 bool dirty; | 555 bool dirty; |
552 if (NewEntry(address, &cache_entry, &dirty)) | 556 if (NewEntry(address, &cache_entry, &dirty)) |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 | 1147 |
1144 return num_dirty; | 1148 return num_dirty; |
1145 } | 1149 } |
1146 | 1150 |
1147 bool BackendImpl::CheckEntry(EntryImpl* cache_entry) { | 1151 bool BackendImpl::CheckEntry(EntryImpl* cache_entry) { |
1148 RankingsNode* rankings = cache_entry->rankings()->Data(); | 1152 RankingsNode* rankings = cache_entry->rankings()->Data(); |
1149 return !rankings->pointer; | 1153 return !rankings->pointer; |
1150 } | 1154 } |
1151 | 1155 |
1152 } // namespace disk_cache | 1156 } // namespace disk_cache |
OLD | NEW |