Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: net/disk_cache/blockfile/block_files.h

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/disk_cache/blockfile/block_bitmaps_v3.cc ('k') | net/disk_cache/blockfile/block_files.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/block_bitmaps_v3.cc ('k') | net/disk_cache/blockfile/block_files.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698