Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "net/disk_cache/simple/simple_index_file.h" | |
| 6 | |
| 7 #include <string> | |
| 8 | |
| 9 #include "base/files/file_enumerator.h" | |
| 10 #include "base/files/file_path.h" | |
| 11 | |
| 12 namespace disk_cache { | |
| 13 | |
| 14 // static | |
| 15 bool SimpleIndexFile::TraverseCacheDirectory( | |
| 16 const base::FilePath& cache_path, | |
| 17 const EntryFileCallback& entry_file_callback) { | |
| 18 const int kFileSuffixLength = sizeof("_0") - 1; | |
|
pasko
2013/08/21 16:03:17
this constant is unused
also, the operation of th
Philippe
2013/08/21 16:20:58
Oops :) Yeah good point.
| |
| 19 const base::FilePath::StringType file_pattern = FILE_PATH_LITERAL("*_[0-2]"); | |
| 20 base::FileEnumerator enumerator( | |
| 21 cache_path, false /* recursive */, base::FileEnumerator::FILES, | |
| 22 file_pattern); | |
| 23 for (base::FilePath file_path = enumerator.Next(); !file_path.empty(); | |
| 24 file_path = enumerator.Next()) { | |
| 25 entry_file_callback.Run(file_path); | |
| 26 } | |
| 27 return true; | |
| 28 } | |
| 29 | |
| 30 } // namespace disk_cache | |
| OLD | NEW |