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

Unified Diff: net/disk_cache/addr.h

Issue 17507006: Disk cache v3 ref2 Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Incl IndexTable cl Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/disk_cache/addr.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/addr.h
===================================================================
--- net/disk_cache/addr.h (revision 232523)
+++ net/disk_cache/addr.h (working copy)
@@ -108,6 +108,11 @@
return value_ != other.value_;
}
+ // Conversions between the address of an external file and the address of the
+ // control block of that external file.
+ Addr AsExternal() const;
+ Addr AsBlockFile() const;
+
static Addr FromEntryAddress(uint32 value) {
return Addr(kInitializedMask + (BLOCK_ENTRIES << kFileTypeOffset) + value);
}
@@ -116,6 +121,11 @@
return Addr(kInitializedMask + (BLOCK_EVICTED << kFileTypeOffset) + value);
}
+ // Returns the part of the address that could be stored by the index.
+ uint32 ToIndexEntryAddress() const {
+ return value_ & (kFileSelectorMask | kStartBlockMask);
+ }
+
static int BlockSizeForFileType(FileType file_type) {
switch (file_type) {
case RANKINGS:
@@ -165,6 +175,8 @@
return value_ & kReservedBitsMask;
}
+ void SetFileType(FileType type);
+
static const uint32 kInitializedMask = 0x80000000;
static const uint32 kFileTypeMask = 0x70000000;
static const uint32 kFileTypeOffset = 28;
« no previous file with comments | « no previous file | net/disk_cache/addr.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698