summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/addr.h
diff options
context:
space:
mode:
authorrvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-10 00:25:15 +0000
committerrvargas@chromium.org <rvargas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-01-10 00:25:15 +0000
commitb46767a36914907cbe36d7953980a5a399041806 (patch)
tree9870b5ac0004c21730d372c8fe7da1bf5bbf297b /net/disk_cache/addr.h
parent86ba1fe0d2582adf113f68a32532277017c4449f (diff)
downloadchromium_src-b46767a36914907cbe36d7953980a5a399041806.zip
chromium_src-b46767a36914907cbe36d7953980a5a399041806.tar.gz
chromium_src-b46767a36914907cbe36d7953980a5a399041806.tar.bz2
Disk cache v3: The main index table.
The IndexTable controls what entries are stored in the cache. This class provides a memory-only view of the underlying structures that store "the index" BUG=241277 TEST=net_unittests Review URL: https://codereview.chromium.org/53313004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244027 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/disk_cache/addr.h')
-rw-r--r--net/disk_cache/addr.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/net/disk_cache/addr.h b/net/disk_cache/addr.h
index f0fb1ca..664e462 100644
--- a/net/disk_cache/addr.h
+++ b/net/disk_cache/addr.h
@@ -54,6 +54,18 @@ const int kFirstAdditionalBlockFileV3 = 7;
// 0000 0011 0000 0000 0000 0000 0000 0000 : number of contiguous blocks 1-4
// 0000 0000 1111 1111 0000 0000 0000 0000 : file selector 0 - 255
// 0000 0000 0000 0000 1111 1111 1111 1111 : block# 0 - 65,535 (2^16)
+//
+// Note that an Addr can be used to "point" to a variety of different objects,
+// from a given type of entry to random blobs of data. Conceptually, an Addr is
+// just a number that someone can inspect to find out how to locate the desired
+// record. Most users will not care about the specific bits inside Addr, for
+// example, what parts of it point to a file number; only the code that has to
+// select a specific file would care about those specific bits.
+//
+// From a general point of view, an Addr has a total capacity of 2^24 entities,
+// in that it has 24 bits that can identify individual records. Note that the
+// address space is bigger for independent files (2^28), but that would not be
+// the general case.
class NET_EXPORT_PRIVATE Addr {
public:
Addr() : value_(0) {}
@@ -108,14 +120,6 @@ class NET_EXPORT_PRIVATE Addr {
return value_ != other.value_;
}
- static Addr FromEntryAddress(uint32 value) {
- return Addr(kInitializedMask + (BLOCK_ENTRIES << kFileTypeOffset) + value);
- }
-
- static Addr FromEvictedAddress(uint32 value) {
- return Addr(kInitializedMask + (BLOCK_EVICTED << kFileTypeOffset) + value);
- }
-
static int BlockSizeForFileType(FileType file_type) {
switch (file_type) {
case RANKINGS: