Index: net/disk_cache/simple/simple_index_file_win.cc |
diff --git a/net/disk_cache/simple/simple_index_file_win.cc b/net/disk_cache/simple/simple_index_file_win.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..9e27c028cda4b1219304ea57ff481b2693a0e3cd |
--- /dev/null |
+++ b/net/disk_cache/simple/simple_index_file_win.cc |
@@ -0,0 +1,39 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "net/disk_cache/simple/simple_index_file.h" |
+ |
+#include <string> |
+ |
+#include "base/callback.h" |
+#include "base/files/file_enumerator.h" |
+#include "base/files/file_path.h" |
+#include "base/files/file_util.h" |
+ |
+namespace disk_cache { |
+ |
+// static |
+bool SimpleIndexFile::TraverseCacheDirectory( |
+ const std::string& cache_path, |
+ const EntryFileCallback& entry_file_callback) { |
+ const int kFileSuffixLength = sizeof("_0") - 1; |
+ const base::FilePath::StringType file_pattern = FILE_PATH_LITERAL("*_[0-2]"); |
+ base::FileEnumerator enumerator( |
+ base::FilePath(cache_path), false /* recursive */, |
+ base::FileEnumerator::FILES, file_pattern); |
+ for (base::FilePath file_path = enumerator.Next(); !file_path.empty(); |
+ file_path = enumerator.Next()) { |
+ entry_file_callback.Run(file_path.value().c_str()); |
+ } |
+ return true; |
+} |
+ |
+// static |
+bool SimpleIndexFile::GetPlatformFileInfo(const char* path, |
+ base::PlatformFileInfo* info) { |
+ *info = file_util::GetFileInfo(base::FilePath(path)); |
+ return true; |
+} |
+ |
+} // namespace disk_cache |