| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_FILE_H_ | 5 #ifndef NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_FILE_H_ |
| 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_FILE_H_ | 6 #define NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_FILE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 const SimpleIndex::EntrySet& entry_set, | 98 const SimpleIndex::EntrySet& entry_set, |
| 99 uint64_t cache_size, | 99 uint64_t cache_size, |
| 100 const base::TimeTicks& start, | 100 const base::TimeTicks& start, |
| 101 bool app_on_background, | 101 bool app_on_background, |
| 102 const base::Closure& callback); | 102 const base::Closure& callback); |
| 103 | 103 |
| 104 private: | 104 private: |
| 105 friend class WrappedSimpleIndexFile; | 105 friend class WrappedSimpleIndexFile; |
| 106 | 106 |
| 107 // Used for cache directory traversal. | 107 // Used for cache directory traversal. |
| 108 typedef base::Callback<void (const base::FilePath&)> EntryFileCallback; | 108 using EntryFileCallback = base::Callback<void(const base::FilePath&, |
| 109 base::Time last_accessed, |
| 110 base::Time last_modified, |
| 111 int64_t size)>; |
| 109 | 112 |
| 110 // When loading the entries from disk, add this many extra hash buckets to | 113 // When loading the entries from disk, add this many extra hash buckets to |
| 111 // prevent reallocation on the IO thread when merging in new live entries. | 114 // prevent reallocation on the IO thread when merging in new live entries. |
| 112 static const int kExtraSizeForMerge = 512; | 115 static const int kExtraSizeForMerge = 512; |
| 113 | 116 |
| 114 // Synchronous (IO performing) implementation of LoadIndexEntries. | 117 // Synchronous (IO performing) implementation of LoadIndexEntries. |
| 115 static void SyncLoadIndexEntries(net::CacheType cache_type, | 118 static void SyncLoadIndexEntries(net::CacheType cache_type, |
| 116 base::Time cache_last_modified, | 119 base::Time cache_last_modified, |
| 117 const base::FilePath& cache_directory, | 120 const base::FilePath& cache_directory, |
| 118 const base::FilePath& index_file_path, | 121 const base::FilePath& index_file_path, |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 static const char kIndexFileName[]; | 194 static const char kIndexFileName[]; |
| 192 static const char kTempIndexFileName[]; | 195 static const char kTempIndexFileName[]; |
| 193 | 196 |
| 194 DISALLOW_COPY_AND_ASSIGN(SimpleIndexFile); | 197 DISALLOW_COPY_AND_ASSIGN(SimpleIndexFile); |
| 195 }; | 198 }; |
| 196 | 199 |
| 197 | 200 |
| 198 } // namespace disk_cache | 201 } // namespace disk_cache |
| 199 | 202 |
| 200 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_FILE_H_ | 203 #endif // NET_DISK_CACHE_SIMPLE_SIMPLE_INDEX_FILE_H_ |
| OLD | NEW |