Index: net/disk_cache/simple/simple_entry_format.h |
diff --git a/net/disk_cache/simple/simple_entry_format.h b/net/disk_cache/simple/simple_entry_format.h |
index aec7162f2c2775da3da85e5ed65ad35e5064ff3f..30a369358fb6723aad54a8369a62174cf1dfef7b 100644 |
--- a/net/disk_cache/simple/simple_entry_format.h |
+++ b/net/disk_cache/simple/simple_entry_format.h |
@@ -25,7 +25,15 @@ const uint64_t kSimpleSparseRangeMagicNumber = UINT64_C(0xeb97bf016553676b); |
// - the data from stream 1. |
// - a SimpleFileEOF record for stream 1. |
// - the data from stream 0. |
+// - (optionally) the SHA256 of the key. |
// - a SimpleFileEOF record for stream 0. |
+// |
+// Because stream 0 data (typically HTTP headers) is on the critical path of |
+// requests, on open, the cache reads the end of the record and does not |
+// read the SimpleFileHeader. If the key can be validated with a SHA256, then |
+// the stream 0 data can be returned to the caller without reading the |
+// SimpleFileHeader. If the key SHA256 is not present, then the cache must |
+// read the SimpleFileHeader to confirm key equality. |
// A file containing stream 2 in the Simple cache consists of: |
// - a SimpleFileHeader. |
@@ -47,6 +55,7 @@ struct NET_EXPORT_PRIVATE SimpleFileHeader { |
struct NET_EXPORT_PRIVATE SimpleFileEOF { |
enum Flags { |
FLAG_HAS_CRC32 = (1U << 0), |
+ FLAG_HAS_KEY_SHA256 = (1U << 1), // Preceding the record if present. |
}; |
SimpleFileEOF(); |