Index: net/disk_cache/simple/simple_index.cc |
diff --git a/net/disk_cache/simple/simple_index.cc b/net/disk_cache/simple/simple_index.cc |
index 7effb1ba591e2e7fb1b9f87f6ec41c88f61684c1..eb56a63ab93f2e5d05f83a7ea81b6148a46537b0 100644 |
--- a/net/disk_cache/simple/simple_index.cc |
+++ b/net/disk_cache/simple/simple_index.cc |
@@ -9,6 +9,7 @@ |
#include "base/bind.h" |
#include "base/bind_helpers.h" |
#include "base/file_util.h" |
+#include "base/files/file_enumerator.h" |
#include "base/logging.h" |
#include "base/message_loop.h" |
#include "base/metrics/histogram.h" |
@@ -447,7 +448,6 @@ void SimpleIndex::InitializeInternal( |
// static |
scoped_ptr<SimpleIndex::EntrySet> SimpleIndex::RestoreFromDisk( |
const base::FilePath& index_filename) { |
- using file_util::FileEnumerator; |
LOG(INFO) << "Simple Cache Index is being restored from disk."; |
file_util::Delete(index_filename, /* recursive = */ false); |
@@ -459,10 +459,10 @@ scoped_ptr<SimpleIndex::EntrySet> SimpleIndex::RestoreFromDisk( |
const int kFileSuffixLenght = std::string("_0").size(); |
const base::FilePath::StringType file_pattern = FILE_PATH_LITERAL("*_[0-2]"); |
- FileEnumerator enumerator(index_filename.DirName(), |
- false /* recursive */, |
- FileEnumerator::FILES, |
- file_pattern); |
+ base::FileEnumerator enumerator(index_filename.DirName(), |
+ false /* recursive */, |
+ base::FileEnumerator::FILES, |
+ file_pattern); |
for (base::FilePath file_path = enumerator.Next(); !file_path.empty(); |
file_path = enumerator.Next()) { |
const base::FilePath::StringType base_name = file_path.BaseName().value(); |
@@ -480,18 +480,17 @@ scoped_ptr<SimpleIndex::EntrySet> SimpleIndex::RestoreFromDisk( |
continue; |
} |
- FileEnumerator::FindInfo find_info = {}; |
- enumerator.GetFindInfo(&find_info); |
+ base::FileEnumerator::FileInfo find_info = enumerator.GetInfo(); |
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 = base::Time::FromTimeT(find_info.stat.st_atime); |
+ last_used_time = base::Time::FromTimeT(find_info.stat().st_atime); |
#endif |
if (last_used_time.is_null()) |
- last_used_time = FileEnumerator::GetLastModifiedTime(find_info); |
+ last_used_time = find_info.GetLastModifiedTime(); |
- int64 file_size = FileEnumerator::GetFilesize(find_info); |
+ int64 file_size = find_info.GetSize(); |
EntrySet::iterator it = index_file_entries->find(hash_key); |
if (it == index_file_entries->end()) { |
InsertInEntrySet(EntryMetadata(hash_key, last_used_time, file_size), |