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

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

Issue 22571011: Remove simple_util::GetMTime from simple cache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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_backend_impl.cc ('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 0136be1c5a063049617d2abf628bcec61968c0da..938ae8eb3c587a30937e134fedcc0e3198d0f2a1 100644
--- a/net/disk_cache/simple/simple_index_file.cc
+++ b/net/disk_cache/simple/simple_index_file.cc
@@ -242,9 +242,10 @@ void SimpleIndexFile::SyncLoadIndexEntries(
index_file_state = INDEX_STATE_STALE;
} else {
index_file_state = INDEX_STATE_FRESH;
- base::Time latest_dir_mtime;
- if (simple_util::GetMTime(cache_directory, &latest_dir_mtime) &&
- IsIndexFileStale(latest_dir_mtime, index_file_path)) {
+ base::PlatformFileInfo file_info;
+ bool file_info_result = file_util::GetFileInfo(index_file_path, &file_info);
+ DCHECK(file_info_result);
+ if (IsIndexFileStale(file_info.last_modified, index_file_path)) {
// A file operation has updated the directory since we last looked at it
// during backend initialization.
index_file_state = INDEX_STATE_FRESH_CONCURRENT_UPDATES;
@@ -418,10 +419,10 @@ void SimpleIndexFile::SyncRestoreFromDisk(
// static
bool SimpleIndexFile::IsIndexFileStale(base::Time cache_last_modified,
const base::FilePath& index_file_path) {
- base::Time index_mtime;
- if (!simple_util::GetMTime(index_file_path, &index_mtime))
+ base::PlatformFileInfo file_info;
+ if (!file_util::GetFileInfo(index_file_path, &file_info))
return true;
- return index_mtime < cache_last_modified;
+ return file_info.last_modified < cache_last_modified;
}
} // namespace disk_cache
« no previous file with comments | « net/disk_cache/simple/simple_backend_impl.cc ('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