Index: net/disk_cache/simple/simple_index_file.cc |
diff --git a/net/disk_cache/simple/simple_index_file.cc b/net/disk_cache/simple/simple_index_file.cc |
index 01eaba1e00cd1ca1753b416e5fa171ca61dc9441..550c5f2ee9a5d4cb30d557c3132e0627151bb12b 100644 |
--- a/net/disk_cache/simple/simple_index_file.cc |
+++ b/net/disk_cache/simple/simple_index_file.cc |
@@ -340,11 +340,12 @@ bool SimpleIndexFile::IndexMetadata::CheckIndexMetadata() { |
return false; |
} |
- static_assert(kSimpleVersion == 7, "index metadata reader out of date"); |
+ static_assert(kSimpleVersion == 8, "index metadata reader out of date"); |
// No |reason_| is saved in the version 6 file format. |
if (version_ == 6) |
return reason_ == SimpleIndex::INDEX_WRITE_REASON_MAX; |
- return version_ == 7 && reason_ < SimpleIndex::INDEX_WRITE_REASON_MAX; |
+ return (version_ == 7 || version_ == 8) && |
+ reason_ < SimpleIndex::INDEX_WRITE_REASON_MAX; |
} |
SimpleIndexFile::SimpleIndexFile( |
@@ -559,7 +560,8 @@ void SimpleIndexFile::Deserialize(const char* data, int data_len, |
uint64_t hash_key; |
EntryMetadata entry_metadata; |
if (!pickle_it.ReadUInt64(&hash_key) || |
- !entry_metadata.Deserialize(&pickle_it)) { |
+ !entry_metadata.Deserialize(&pickle_it, |
+ index_metadata.has_memory_entry_data())) { |
LOG(WARNING) << "Invalid EntryMetadata in Simple Index file."; |
entries->clear(); |
return; |