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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // Attemp to grow this file. Fails if the file cannot be extended anymore. | 129 // Attemp to grow this file. Fails if the file cannot be extended anymore. |
130 bool GrowBlockFile(MappedFile* file, BlockFileHeader* header); | 130 bool GrowBlockFile(MappedFile* file, BlockFileHeader* header); |
131 | 131 |
132 // Returns the appropriate file to use for a new block. | 132 // Returns the appropriate file to use for a new block. |
133 MappedFile* FileForNewBlock(FileType block_type, int block_count); | 133 MappedFile* FileForNewBlock(FileType block_type, int block_count); |
134 | 134 |
135 // Returns the next block file on this chain, creating new files if needed. | 135 // Returns the next block file on this chain, creating new files if needed. |
136 MappedFile* NextFile(MappedFile* file); | 136 MappedFile* NextFile(MappedFile* file); |
137 | 137 |
138 // Creates an empty block file and returns its index. | 138 // Creates an empty block file and returns its index. |
139 int CreateNextBlockFile(FileType block_type); | 139 int16 CreateNextBlockFile(FileType block_type); |
140 | 140 |
141 // Removes a chained block file that is now empty. | 141 // Removes a chained block file that is now empty. |
142 bool RemoveEmptyFile(FileType block_type); | 142 bool RemoveEmptyFile(FileType block_type); |
143 | 143 |
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 |
(...skipping 10 matching lines...) Expand all Loading... |
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 |