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

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

Issue 1910023002: Remove partial blockfile v3 disk_cache implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // See net/disk_cache/disk_cache.h for the public interface.
6
7 #ifndef NET_DISK_CACHE_BLOCKFILE_BLOCK_BITMAPS_V3_H_
8 #define NET_DISK_CACHE_BLOCKFILE_BLOCK_BITMAPS_V3_H_
9
10 #include "base/files/file_path.h"
11 #include "base/macros.h"
12 #include "net/base/net_export.h"
13 #include "net/disk_cache/blockfile/addr.h"
14 #include "net/disk_cache/blockfile/block_files.h"
15
16 namespace disk_cache {
17
18 class BackendImplV3;
19
20 // This class is the interface in the v3 disk cache to the set of files holding
21 // cached data that is small enough to not be efficiently stored in a dedicated
22 // file (i.e. < kMaxBlockSize). It is primarily used to allocate and free
23 // regions in those files used to store data.
24 class NET_EXPORT_PRIVATE BlockBitmaps {
25 public:
26 BlockBitmaps();
27 ~BlockBitmaps();
28
29 void Init(const BlockFilesBitmaps& bitmaps);
30
31 // Creates a new entry on a block file. block_type indicates the size of block
32 // to be used (as defined on cache_addr.h), block_count is the number of
33 // blocks to allocate, and block_address is the address of the new entry.
34 bool CreateBlock(FileType block_type, int block_count, Addr* block_address);
35
36 // Removes an entry from the block files.
37 void DeleteBlock(Addr address);
38
39 // Releases the internal bitmaps. The cache is being purged.
40 void Clear();
41
42 // Sends UMA stats.
43 void ReportStats();
44
45 // Returns true if the blocks pointed by a given address are currently used.
46 // This method is only intended for debugging.
47 bool IsValid(Addr address);
48
49 private:
50 // Returns the header number that stores a given address.
51 int GetHeaderNumber(Addr address);
52
53 // Returns the appropriate header to use for a new block.
54 int HeaderNumberForNewBlock(FileType block_type, int block_count);
55
56 // Retrieves stats for the given file index.
57 void GetFileStats(int index, int* used_count, int* load);
58
59 BlockFilesBitmaps bitmaps_;
60
61 DISALLOW_COPY_AND_ASSIGN(BlockBitmaps);
62 };
63
64 } // namespace disk_cache
65
66 #endif // NET_DISK_CACHE_BLOCKFILE_BLOCK_BITMAPS_V3_H_
OLDNEW
« no previous file with comments | « net/disk_cache/blockfile/backend_worker_v3.cc ('k') | net/disk_cache/blockfile/block_bitmaps_v3.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698