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

Unified Diff: chrome/browser/chromeos/policy/app_pack_updater.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/browser/chromeos/policy/app_pack_updater.cc
diff --git a/chrome/browser/chromeos/policy/app_pack_updater.cc b/chrome/browser/chromeos/policy/app_pack_updater.cc
index 26478531c39a15805f1c457610b58422d832f791..f1559e173d20de9bb1915505674fa2b5224084ac 100644
--- a/chrome/browser/chromeos/policy/app_pack_updater.cc
+++ b/chrome/browser/chromeos/policy/app_pack_updater.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/file_util.h"
+#include "base/files/file_enumerator.h"
#include "base/location.h"
#include "base/stl_util.h"
#include "base/string_util.h"
@@ -29,7 +30,6 @@
#include "content/public/browser/notification_source.h"
using content::BrowserThread;
-using file_util::FileEnumerator;
namespace policy {
@@ -250,18 +250,16 @@ void AppPackUpdater::BlockingCheckCacheInternal(
// Enumerate all the files in the cache |dir|, including directories
// and symlinks. Each unrecognized file will be erased.
- int types = FileEnumerator::FILES | FileEnumerator::DIRECTORIES |
- FileEnumerator::SHOW_SYM_LINKS;
- FileEnumerator enumerator(dir, false /* recursive */, types);
+ int types = base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES |
+ base::FileEnumerator::SHOW_SYM_LINKS;
+ base::FileEnumerator enumerator(dir, false /* recursive */, types);
for (base::FilePath path = enumerator.Next();
!path.empty(); path = enumerator.Next()) {
- FileEnumerator::FindInfo info;
- enumerator.GetFindInfo(&info);
+ base::FileEnumerator::FileInfo info = enumerator.GetInfo();
std::string basename = path.BaseName().value();
- if (FileEnumerator::IsDirectory(info) ||
- file_util::IsLink(FileEnumerator::GetFilename(info))) {
+ if (info.IsDirectory() || file_util::IsLink(info.GetName())) {
LOG(ERROR) << "Erasing bad file in AppPack directory: " << basename;
file_util::Delete(path, true /* recursive */);
continue;

Powered by Google App Engine
This is Rietveld 408576698