Chromium Code Reviews| 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 7925a7adc33a9ec68df75996990a6d749be7678e..3557a616068ca544832c1c8ba54478946c8d5b07 100644 |
| --- a/net/disk_cache/simple/simple_index_file.cc |
| +++ b/net/disk_cache/simple/simple_index_file.cc |
| @@ -120,7 +120,10 @@ bool WritePickleFile(base::Pickle* pickle, const base::FilePath& file_name) { |
| // Called for each cache directory traversal iteration. |
| void ProcessEntryFile(SimpleIndex::EntrySet* entries, |
| - const base::FilePath& file_path) { |
| + const base::FilePath& file_path, |
| + base::Time last_accessed, |
|
jkarlin
2017/03/27 14:09:15
Could we instead take a 'const base::FileInfo& fil
Maks Orlovich
2017/03/27 15:25:44
We don't have a base::FileInfo on the Windows path
|
| + base::Time last_modified, |
| + int64_t size) { |
| static const size_t kEntryFilesLength = |
| kEntryFilesHashLength + kEntryFilesSuffixLength; |
| // Converting to std::string is OK since we never use UTF8 wide chars in our |
| @@ -138,22 +141,17 @@ void ProcessEntryFile(SimpleIndex::EntrySet* entries, |
| return; |
| } |
| - File::Info file_info; |
| - if (!base::GetFileInfo(file_path, &file_info)) { |
| - LOG(ERROR) << "Could not get file info for " << file_path.value(); |
| - return; |
| - } |
| base::Time last_used_time; |
| #if defined(OS_POSIX) |
| // For POSIX systems, a last access time is available. However, it's not |
| // guaranteed to be more accurate than mtime. It is no worse though. |
| - last_used_time = file_info.last_accessed; |
| + last_used_time = last_accessed; |
| #endif |
| if (last_used_time.is_null()) |
| - last_used_time = file_info.last_modified; |
| + last_used_time = last_modified; |
| SimpleIndex::EntrySet::iterator it = entries->find(hash_key); |
| - base::CheckedNumeric<uint32_t> total_entry_size = file_info.size; |
| + base::CheckedNumeric<uint32_t> total_entry_size = size; |
| if (it == entries->end()) { |
| SimpleIndex::InsertInEntrySet( |