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

Unified Diff: chrome/common/extensions/extension_file_util.cc

Issue 16392011: Move FileEnumerator to its own file, do some refactoring. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix incorrect includes Created 7 years, 6 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
Index: chrome/common/extensions/extension_file_util.cc
diff --git a/chrome/common/extensions/extension_file_util.cc b/chrome/common/extensions/extension_file_util.cc
index 327a572a1c66118d6be26025586e66f03befb050..2f4b4463813b7a4f9fb6c616b9b9c63cc1dbf64a 100644
--- a/chrome/common/extensions/extension_file_util.cc
+++ b/chrome/common/extensions/extension_file_util.cc
@@ -8,6 +8,7 @@
#include <vector>
#include "base/file_util.h"
+#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/scoped_temp_dir.h"
#include "base/json/json_file_value_serializer.h"
@@ -202,8 +203,8 @@ std::vector<base::FilePath> FindPrivateKeyFiles(
const base::FilePath& extension_dir) {
std::vector<base::FilePath> result;
// Pattern matching only works at the root level, so filter manually.
- file_util::FileEnumerator traversal(extension_dir, /*recursive=*/true,
- file_util::FileEnumerator::FILES);
+ base::FileEnumerator traversal(extension_dir, /*recursive=*/true,
+ base::FileEnumerator::FILES);
for (base::FilePath current = traversal.Next(); !current.empty();
current = traversal.Next()) {
if (!current.MatchesExtension(chrome::kExtensionKeyFileExtension))
@@ -331,9 +332,9 @@ void GarbageCollectExtensions(
return;
DVLOG(1) << "Garbage collecting extensions...";
- file_util::FileEnumerator enumerator(install_directory,
- false, // Not recursive.
- file_util::FileEnumerator::DIRECTORIES);
+ base::FileEnumerator enumerator(install_directory,
+ false, // Not recursive.
+ base::FileEnumerator::DIRECTORIES);
base::FilePath extension_path;
for (extension_path = enumerator.Next(); !extension_path.value().empty();
extension_path = enumerator.Next()) {
@@ -378,10 +379,10 @@ void GarbageCollectExtensions(
}
// Clean up old version directories.
- file_util::FileEnumerator versions_enumerator(
+ base::FileEnumerator versions_enumerator(
extension_path,
false, // Not recursive.
- file_util::FileEnumerator::DIRECTORIES);
+ base::FileEnumerator::DIRECTORIES);
for (base::FilePath version_dir = versions_enumerator.Next();
!version_dir.value().empty();
version_dir = versions_enumerator.Next()) {
@@ -471,9 +472,8 @@ bool CheckForIllegalFilenames(const base::FilePath& extension_path,
// There is a problem when using pattern "_*" with FileEnumerator, so we have
// to cheat with find_first_of and match all.
const int kFilesAndDirectories =
- file_util::FileEnumerator::DIRECTORIES | file_util::FileEnumerator::FILES;
- file_util::FileEnumerator all_files(
- extension_path, false, kFilesAndDirectories);
+ base::FileEnumerator::DIRECTORIES | base::FileEnumerator::FILES;
+ base::FileEnumerator all_files(extension_path, false, kFilesAndDirectories);
base::FilePath file;
while (!(file = all_files.Next()).empty()) {
« no previous file with comments | « chrome/common/extensions/api/i18n/default_locale_handler.cc ('k') | chrome/common/extensions/extension_l10n_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698