| 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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 | 634 |
| 635 stats_.OnEvent(Stats::DOOM_ENTRY); | 635 stats_.OnEvent(Stats::DOOM_ENTRY); |
| 636 } | 636 } |
| 637 | 637 |
| 638 // An entry may be linked on the DELETED list for a while after being doomed. | 638 // An entry may be linked on the DELETED list for a while after being doomed. |
| 639 // This function is called when we want to remove it. | 639 // This function is called when we want to remove it. |
| 640 void BackendImpl::RemoveEntry(EntryImpl* entry) { | 640 void BackendImpl::RemoveEntry(EntryImpl* entry) { |
| 641 if (!new_eviction_) | 641 if (!new_eviction_) |
| 642 return; | 642 return; |
| 643 | 643 |
| 644 DCHECK(ENTRY_DOOMED == entry->entry()->Data()->state); | 644 DCHECK(ENTRY_NORMAL != entry->entry()->Data()->state); |
| 645 | 645 |
| 646 Trace("Remove entry 0x%p", entry); | 646 Trace("Remove entry 0x%p", entry); |
| 647 eviction_.OnDestroyEntry(entry); | 647 eviction_.OnDestroyEntry(entry); |
| 648 DecreaseNumEntries(); | 648 DecreaseNumEntries(); |
| 649 } | 649 } |
| 650 | 650 |
| 651 void BackendImpl::CacheEntryDestroyed() { | 651 void BackendImpl::CacheEntryDestroyed() { |
| 652 DecreaseNumRefs(); | 652 DecreaseNumRefs(); |
| 653 } | 653 } |
| 654 | 654 |
| (...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1338 | 1338 |
| 1339 return num_dirty; | 1339 return num_dirty; |
| 1340 } | 1340 } |
| 1341 | 1341 |
| 1342 bool BackendImpl::CheckEntry(EntryImpl* cache_entry) { | 1342 bool BackendImpl::CheckEntry(EntryImpl* cache_entry) { |
| 1343 RankingsNode* rankings = cache_entry->rankings()->Data(); | 1343 RankingsNode* rankings = cache_entry->rankings()->Data(); |
| 1344 return !rankings->pointer; | 1344 return !rankings->pointer; |
| 1345 } | 1345 } |
| 1346 | 1346 |
| 1347 } // namespace disk_cache | 1347 } // namespace disk_cache |
| OLD | NEW |