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 // See net/disk_cache/disk_cache.h for the public interface. | 5 // See net/disk_cache/disk_cache.h for the public interface. |
6 | 6 |
7 #ifndef NET_DISK_CACHE_BLOCKFILE_BLOCK_FILES_H_ | 7 #ifndef NET_DISK_CACHE_BLOCKFILE_BLOCK_FILES_H_ |
8 #define NET_DISK_CACHE_BLOCKFILE_BLOCK_FILES_H_ | 8 #define NET_DISK_CACHE_BLOCKFILE_BLOCK_FILES_H_ |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // Restores the header of a potentially inconsistent file. | 144 // Restores the header of a potentially inconsistent file. |
145 bool FixBlockFileHeader(MappedFile* file); | 145 bool FixBlockFileHeader(MappedFile* file); |
146 | 146 |
147 // Retrieves stats for the given file index. | 147 // Retrieves stats for the given file index. |
148 void GetFileStats(int index, int* used_count, int* load); | 148 void GetFileStats(int index, int* used_count, int* load); |
149 | 149 |
150 // Returns the filename for a given file index. | 150 // Returns the filename for a given file index. |
151 base::FilePath Name(int index); | 151 base::FilePath Name(int index); |
152 | 152 |
153 bool init_; | 153 bool init_; |
154 char* zero_buffer_; // Buffer to speed-up cleaning deleted entries. | 154 char* zero_buffer_; // Buffer to speed-up cleaning deleted entries. |
155 base::FilePath path_; // Path to the backing folder. | 155 base::FilePath path_; // Path to the backing folder. |
156 std::vector<MappedFile*> block_files_; // The actual files. | 156 std::vector<MappedFile*> block_files_; // The actual files. |
157 scoped_ptr<base::ThreadChecker> thread_checker_; | 157 scoped_ptr<base::ThreadChecker> thread_checker_; |
158 | 158 |
159 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_ZeroSizeFile); | 159 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_ZeroSizeFile); |
160 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_TruncatedFile); | 160 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_TruncatedFile); |
161 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_InvalidFile); | 161 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_InvalidFile); |
162 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_Stats); | 162 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_Stats); |
163 | 163 |
164 DISALLOW_COPY_AND_ASSIGN(BlockFiles); | 164 DISALLOW_COPY_AND_ASSIGN(BlockFiles); |
165 }; | 165 }; |
166 | 166 |
167 } // namespace disk_cache | 167 } // namespace disk_cache |
168 | 168 |
169 #endif // NET_DISK_CACHE_BLOCKFILE_BLOCK_FILES_H_ | 169 #endif // NET_DISK_CACHE_BLOCKFILE_BLOCK_FILES_H_ |
OLD | NEW |