OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/disk_format.h" | 9 #include "net/disk_cache/disk_format.h" |
10 #include "net/disk_cache/entry_impl.h" | 10 #include "net/disk_cache/entry_impl.h" |
(...skipping 877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
888 *other->Data() = *node->Data(); | 888 *other->Data() = *node->Data(); |
889 } | 889 } |
890 } | 890 } |
891 } | 891 } |
892 | 892 |
893 void Rankings::InvalidateIterators(CacheRankingsBlock* node) { | 893 void Rankings::InvalidateIterators(CacheRankingsBlock* node) { |
894 CacheAddr address = node->address().value(); | 894 CacheAddr address = node->address().value(); |
895 for (IteratorList::iterator it = iterators_.begin(); it != iterators_.end(); | 895 for (IteratorList::iterator it = iterators_.begin(); it != iterators_.end(); |
896 ++it) { | 896 ++it) { |
897 if (it->first == address) { | 897 if (it->first == address) { |
898 DLOG(INFO) << "Invalidating iterator at 0x" << std::hex << address; | 898 DVLOG(0) << "Invalidating iterator at 0x" << std::hex << address; |
899 it->second->Discard(); | 899 it->second->Discard(); |
900 } | 900 } |
901 } | 901 } |
902 } | 902 } |
903 | 903 |
904 void Rankings::IncrementCounter(List list) { | 904 void Rankings::IncrementCounter(List list) { |
905 if (!count_lists_) | 905 if (!count_lists_) |
906 return; | 906 return; |
907 | 907 |
908 DCHECK(control_data_->sizes[list] < kint32max); | 908 DCHECK(control_data_->sizes[list] < kint32max); |
909 if (control_data_->sizes[list] < kint32max) | 909 if (control_data_->sizes[list] < kint32max) |
910 control_data_->sizes[list]++; | 910 control_data_->sizes[list]++; |
911 } | 911 } |
912 | 912 |
913 void Rankings::DecrementCounter(List list) { | 913 void Rankings::DecrementCounter(List list) { |
914 if (!count_lists_) | 914 if (!count_lists_) |
915 return; | 915 return; |
916 | 916 |
917 DCHECK(control_data_->sizes[list] > 0); | 917 DCHECK(control_data_->sizes[list] > 0); |
918 if (control_data_->sizes[list] > 0) | 918 if (control_data_->sizes[list] > 0) |
919 control_data_->sizes[list]--; | 919 control_data_->sizes[list]--; |
920 } | 920 } |
921 | 921 |
922 } // namespace disk_cache | 922 } // namespace disk_cache |
OLD | NEW |