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" |
11 #include "base/sys_info.h" | 11 #include "base/sys_info.h" |
12 #include "base/timer.h" | 12 #include "base/timer.h" |
13 #include "base/worker_pool.h" | 13 #include "base/worker_pool.h" |
14 #include "net/disk_cache/cache_util.h" | 14 #include "net/disk_cache/cache_util.h" |
15 #include "net/disk_cache/entry_impl.h" | 15 #include "net/disk_cache/entry_impl.h" |
16 #include "net/disk_cache/errors.h" | 16 #include "net/disk_cache/errors.h" |
17 #include "net/disk_cache/hash.h" | 17 #include "net/disk_cache/hash.h" |
18 #include "net/disk_cache/file.h" | 18 #include "net/disk_cache/file.h" |
19 | 19 |
| 20 using base::Time; |
| 21 using base::TimeDelta; |
| 22 |
20 namespace { | 23 namespace { |
21 | 24 |
22 const wchar_t* kIndexName = L"index"; | 25 const wchar_t* kIndexName = L"index"; |
23 const int kCleanUpMargin = 1024 * 1024; | 26 const int kCleanUpMargin = 1024 * 1024; |
24 const int kMaxOldFolders = 100; | 27 const int kMaxOldFolders = 100; |
25 | 28 |
26 // Seems like ~160 MB correspond to ~50k entries. | 29 // Seems like ~160 MB correspond to ~50k entries. |
27 const int k64kEntriesStore = 160 * 1000 * 1000; | 30 const int k64kEntriesStore = 160 * 1000 * 1000; |
28 const int kBaseTableLen = 64 * 1024; | 31 const int kBaseTableLen = 64 * 1024; |
29 const int kDefaultCacheSize = 80 * 1024 * 1024; | 32 const int kDefaultCacheSize = 80 * 1024 * 1024; |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1114 | 1117 |
1115 return num_dirty; | 1118 return num_dirty; |
1116 } | 1119 } |
1117 | 1120 |
1118 bool BackendImpl::CheckEntry(EntryImpl* cache_entry) { | 1121 bool BackendImpl::CheckEntry(EntryImpl* cache_entry) { |
1119 RankingsNode* rankings = cache_entry->rankings()->Data(); | 1122 RankingsNode* rankings = cache_entry->rankings()->Data(); |
1120 return !rankings->pointer; | 1123 return !rankings->pointer; |
1121 } | 1124 } |
1122 | 1125 |
1123 } // namespace disk_cache | 1126 } // namespace disk_cache |
OLD | NEW |