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

Unified Diff: net/disk_cache/simple/simple_index_file.cc

Issue 2957133002: Implement in-memory byte hints in SimpleCache (Closed)
Patch Set: Adjust to the interface's naming change. Created 3 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/simple/simple_index_file.h ('k') | net/disk_cache/simple/simple_index_file_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ff26d4c2b1a9673f8514de7c725ac330bb708f95..7af809a88a01964372ea1f470ee940a97e9cbe3a 100644
--- a/net/disk_cache/simple/simple_index_file.cc
+++ b/net/disk_cache/simple/simple_index_file.cc
@@ -337,11 +337,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(
@@ -555,7 +556,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_entry_in_memory_data())) {
LOG(WARNING) << "Invalid EntryMetadata in Simple Index file.";
entries->clear();
return;
« no previous file with comments | « net/disk_cache/simple/simple_index_file.h ('k') | net/disk_cache/simple/simple_index_file_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698