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" |
11 #include "net/disk_cache/histogram_macros.h" | 11 #include "net/disk_cache/histogram_macros.h" |
12 | 12 |
13 using base::Time; | 13 using base::Time; |
14 using base::TimeTicks; | 14 using base::TimeTicks; |
15 | 15 |
16 namespace disk_cache { | 16 namespace disk_cache { |
17 // This is used by crash_cache.exe to generate unit test files. | 17 // This is used by crash_cache.exe to generate unit test files. |
18 NET_TEST RankCrashes g_rankings_crash = NO_CRASH; | 18 NET_EXPORT_PRIVATE RankCrashes g_rankings_crash = NO_CRASH; |
19 } | 19 } |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 enum Operation { | 23 enum Operation { |
24 INSERT = 1, | 24 INSERT = 1, |
25 REMOVE | 25 REMOVE |
26 }; | 26 }; |
27 | 27 |
28 // This class provides a simple lock for the LRU list of rankings. Whenever an | 28 // This class provides a simple lock for the LRU list of rankings. Whenever an |
(...skipping 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 void Rankings::DecrementCounter(List list) { | 864 void Rankings::DecrementCounter(List list) { |
865 if (!count_lists_) | 865 if (!count_lists_) |
866 return; | 866 return; |
867 | 867 |
868 DCHECK(control_data_->sizes[list] > 0); | 868 DCHECK(control_data_->sizes[list] > 0); |
869 if (control_data_->sizes[list] > 0) | 869 if (control_data_->sizes[list] > 0) |
870 control_data_->sizes[list]--; | 870 control_data_->sizes[list]--; |
871 } | 871 } |
872 | 872 |
873 } // namespace disk_cache | 873 } // namespace disk_cache |
OLD | NEW |