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

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

Issue 17816008: Disk cache: Introduce BlockBitmaps for V3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 5 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | net/disk_cache/block_files.cc » ('j') | net/disk_cache/block_files.cc » ('J')
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_BLOCK_FILES_H_ 7 #ifndef NET_DISK_CACHE_BLOCK_FILES_H_
8 #define NET_DISK_CACHE_BLOCK_FILES_H_ 8 #define NET_DISK_CACHE_BLOCK_FILES_H_
9 9
10 #include <vector> 10 #include <vector>
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 void DeleteMapBlock(int index, int block_size); 42 void DeleteMapBlock(int index, int block_size);
43 43
44 // Returns true if the specified block is used. 44 // Returns true if the specified block is used.
45 bool UsedMapBlock(int index, int size); 45 bool UsedMapBlock(int index, int size);
46 46
47 // Restores the "empty counters" and allocation hints. 47 // Restores the "empty counters" and allocation hints.
48 void FixAllocationCounters(); 48 void FixAllocationCounters();
49 49
50 // Returns true if the current block file should not be used as-is to store 50 // Returns true if the current block file should not be used as-is to store
51 // more records. |block_count| is the number of blocks to allocate. 51 // more records. |block_count| is the number of blocks to allocate.
52 bool NeedToGrowBlockFile(int block_count); 52 bool NeedToGrowBlockFile(int block_count) const;
53
54 // Returns true if this block file can be used to store an extra record of
55 // size |block_count|.
56 bool CanAllocate(int block_count) const;
53 57
54 // Returns the number of empty blocks for this file. 58 // Returns the number of empty blocks for this file.
55 int EmptyBlocks() const; 59 int EmptyBlocks() const;
56 60
57 // Returns true if the counters look OK. 61 // Returns true if the counters look OK.
58 bool ValidateCounters() const; 62 bool ValidateCounters() const;
59 63
60 // Returns the size of the wrapped structure (BlockFileHeader). 64 // Returns the size of the wrapped structure (BlockFileHeader).
61 int Size() const; 65 int Size() const;
62 66
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_TruncatedFile); 147 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_TruncatedFile);
144 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_InvalidFile); 148 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_InvalidFile);
145 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_Stats); 149 FRIEND_TEST_ALL_PREFIXES(DiskCacheTest, BlockFiles_Stats);
146 150
147 DISALLOW_COPY_AND_ASSIGN(BlockFiles); 151 DISALLOW_COPY_AND_ASSIGN(BlockFiles);
148 }; 152 };
149 153
150 } // namespace disk_cache 154 } // namespace disk_cache
151 155
152 #endif // NET_DISK_CACHE_BLOCK_FILES_H_ 156 #endif // NET_DISK_CACHE_BLOCK_FILES_H_
OLDNEW
« no previous file with comments | « no previous file | net/disk_cache/block_files.cc » ('j') | net/disk_cache/block_files.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698