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

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

Issue 2774923002: Try to speed up SimpleCache index re-sync on Windows. (Closed)
Patch Set: git cl try Created 3 years, 9 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_posix.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 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,
+ 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(
« no previous file with comments | « net/disk_cache/simple/simple_index_file.h ('k') | net/disk_cache/simple/simple_index_file_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698