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 // The eviction policy is a very simple pure LRU, so the elements at the end of | 5 // The eviction policy is a very simple pure LRU, so the elements at the end of |
6 // the list are evicted until kCleanUpMargin free space is available. There is | 6 // the list are evicted until kCleanUpMargin free space is available. There is |
7 // only one list in use (Rankings::NO_USE), and elements are sent to the front | 7 // only one list in use (Rankings::NO_USE), and elements are sent to the front |
8 // of the list whenever they are accessed. | 8 // of the list whenever they are accessed. |
9 | 9 |
10 // The new (in-development) eviction policy adds re-use as a factor to evict | 10 // The new (in-development) eviction policy adds re-use as a factor to evict |
(...skipping 18 matching lines...) Expand all Loading... |
29 #include "net/disk_cache/blockfile/eviction.h" | 29 #include "net/disk_cache/blockfile/eviction.h" |
30 | 30 |
31 #include <stdint.h> | 31 #include <stdint.h> |
32 | 32 |
33 #include <limits> | 33 #include <limits> |
34 | 34 |
35 #include "base/bind.h" | 35 #include "base/bind.h" |
36 #include "base/compiler_specific.h" | 36 #include "base/compiler_specific.h" |
37 #include "base/location.h" | 37 #include "base/location.h" |
38 #include "base/logging.h" | 38 #include "base/logging.h" |
| 39 #include "base/metrics/histogram_macros.h" |
39 #include "base/single_thread_task_runner.h" | 40 #include "base/single_thread_task_runner.h" |
40 #include "base/strings/string_util.h" | 41 #include "base/strings/string_util.h" |
41 #include "base/threading/thread_task_runner_handle.h" | 42 #include "base/threading/thread_task_runner_handle.h" |
42 #include "base/time/time.h" | 43 #include "base/time/time.h" |
43 #include "net/disk_cache/blockfile/backend_impl.h" | 44 #include "net/disk_cache/blockfile/backend_impl.h" |
44 #include "net/disk_cache/blockfile/disk_format.h" | 45 #include "net/disk_cache/blockfile/disk_format.h" |
45 #include "net/disk_cache/blockfile/entry_impl.h" | 46 #include "net/disk_cache/blockfile/entry_impl.h" |
46 #include "net/disk_cache/blockfile/experiments.h" | 47 #include "net/disk_cache/blockfile/experiments.h" |
47 #include "net/disk_cache/blockfile/histogram_macros.h" | 48 #include "net/disk_cache/blockfile/histogram_macros.h" |
48 #include "net/disk_cache/blockfile/trace.h" | 49 #include "net/disk_cache/blockfile/trace.h" |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 Time::FromInternalValue(last2.get()->Data()->last_used)); | 599 Time::FromInternalValue(last2.get()->Data()->last_used)); |
599 if (last3.get()) | 600 if (last3.get()) |
600 CACHE_UMA(AGE, "HighUseAge", 0, | 601 CACHE_UMA(AGE, "HighUseAge", 0, |
601 Time::FromInternalValue(last3.get()->Data()->last_used)); | 602 Time::FromInternalValue(last3.get()->Data()->last_used)); |
602 if (last4.get()) | 603 if (last4.get()) |
603 CACHE_UMA(AGE, "DeletedAge", 0, | 604 CACHE_UMA(AGE, "DeletedAge", 0, |
604 Time::FromInternalValue(last4.get()->Data()->last_used)); | 605 Time::FromInternalValue(last4.get()->Data()->last_used)); |
605 } | 606 } |
606 | 607 |
607 } // namespace disk_cache | 608 } // namespace disk_cache |
OLD | NEW |