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

Unified Diff: net/disk_cache/cache_util_posix.cc

Issue 13165005: Move FileEnumerator to its own file, do some refactoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge, fixes Created 7 years, 7 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/block_files_unittest.cc ('k') | net/disk_cache/simple/simple_index.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/cache_util_posix.cc
diff --git a/net/disk_cache/cache_util_posix.cc b/net/disk_cache/cache_util_posix.cc
index 3cc9f3b488bba8ba27d45ea2eb841cad162f4410..ffd810786409b06c44da9223c8bf850e83032e89 100644
--- a/net/disk_cache/cache_util_posix.cc
+++ b/net/disk_cache/cache_util_posix.cc
@@ -5,6 +5,7 @@
#include "net/disk_cache/cache_util.h"
#include "base/file_util.h"
+#include "base/files/file_enumerator.h"
#include "base/logging.h"
#include "base/string_util.h"
@@ -22,9 +23,8 @@ bool MoveCache(const base::FilePath& from_path, const base::FilePath& to_path) {
LOG(ERROR) << "Unable to create destination cache directory.";
return false;
}
- file_util::FileEnumerator iter(from_path, false /* not recursive */,
- file_util::FileEnumerator::DIRECTORIES |
- file_util::FileEnumerator::FILES);
+ base::FileEnumerator iter(from_path, false /* not recursive */,
+ base::FileEnumerator::DIRECTORIES | base::FileEnumerator::FILES);
for (base::FilePath name = iter.Next(); !name.value().empty();
name = iter.Next()) {
base::FilePath destination = to_path.Append(name.BaseName());
@@ -40,9 +40,9 @@ bool MoveCache(const base::FilePath& from_path, const base::FilePath& to_path) {
}
void DeleteCache(const base::FilePath& path, bool remove_folder) {
- file_util::FileEnumerator iter(path,
- /* recursive */ false,
- file_util::FileEnumerator::FILES);
+ base::FileEnumerator iter(path,
+ /* recursive */ false,
+ base::FileEnumerator::FILES);
for (base::FilePath file = iter.Next(); !file.value().empty();
file = iter.Next()) {
if (!file_util::Delete(file, /* recursive */ false)) {
« no previous file with comments | « net/disk_cache/block_files_unittest.cc ('k') | net/disk_cache/simple/simple_index.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698