| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/rankings.h" | 5 #include "net/disk_cache/rankings.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "net/disk_cache/backend_impl.h" | 8 #include "net/disk_cache/backend_impl.h" |
| 9 #include "net/disk_cache/entry_impl.h" | 9 #include "net/disk_cache/entry_impl.h" |
| 10 #include "net/disk_cache/errors.h" | 10 #include "net/disk_cache/errors.h" |
| (...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 *other->Data() = *node->Data(); | 858 *other->Data() = *node->Data(); |
| 859 } | 859 } |
| 860 } | 860 } |
| 861 } | 861 } |
| 862 | 862 |
| 863 void Rankings::InvalidateIterators(CacheRankingsBlock* node) { | 863 void Rankings::InvalidateIterators(CacheRankingsBlock* node) { |
| 864 CacheAddr address = node->address().value(); | 864 CacheAddr address = node->address().value(); |
| 865 for (IteratorList::iterator it = iterators_.begin(); it != iterators_.end(); | 865 for (IteratorList::iterator it = iterators_.begin(); it != iterators_.end(); |
| 866 ++it) { | 866 ++it) { |
| 867 if (it->first == address) { | 867 if (it->first == address) { |
| 868 LOG(WARNING) << "Invalidating iterator at 0x" << std::hex << address; | 868 DLOG(INFO) << "Invalidating iterator at 0x" << std::hex << address; |
| 869 it->second->Discard(); | 869 it->second->Discard(); |
| 870 } | 870 } |
| 871 } | 871 } |
| 872 } | 872 } |
| 873 | 873 |
| 874 void Rankings::IncrementCounter(List list) { | 874 void Rankings::IncrementCounter(List list) { |
| 875 if (!count_lists_) | 875 if (!count_lists_) |
| 876 return; | 876 return; |
| 877 | 877 |
| 878 DCHECK(control_data_->sizes[list] < kint32max); | 878 DCHECK(control_data_->sizes[list] < kint32max); |
| 879 if (control_data_->sizes[list] < kint32max) | 879 if (control_data_->sizes[list] < kint32max) |
| 880 control_data_->sizes[list]++; | 880 control_data_->sizes[list]++; |
| 881 } | 881 } |
| 882 | 882 |
| 883 void Rankings::DecrementCounter(List list) { | 883 void Rankings::DecrementCounter(List list) { |
| 884 if (!count_lists_) | 884 if (!count_lists_) |
| 885 return; | 885 return; |
| 886 | 886 |
| 887 DCHECK(control_data_->sizes[list] > 0); | 887 DCHECK(control_data_->sizes[list] > 0); |
| 888 if (control_data_->sizes[list] > 0) | 888 if (control_data_->sizes[list] > 0) |
| 889 control_data_->sizes[list]--; | 889 control_data_->sizes[list]--; |
| 890 } | 890 } |
| 891 | 891 |
| 892 } // namespace disk_cache | 892 } // namespace disk_cache |
| OLD | NEW |