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

Unified Diff: chrome/browser/media_galleries/fileapi/native_media_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
« no previous file with comments | « chrome/browser/importer/ie_importer.cc ('k') | chrome/browser/policy/config_dir_policy_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media_galleries/fileapi/native_media_file_util.cc
diff --git a/chrome/browser/media_galleries/fileapi/native_media_file_util.cc b/chrome/browser/media_galleries/fileapi/native_media_file_util.cc
index 503fdbbbbdc1a50c6cbe7cd0fe971bd7df1924f3..45a5c1d9e14430f66d772a666d34888994455fea 100644
--- a/chrome/browser/media_galleries/fileapi/native_media_file_util.cc
+++ b/chrome/browser/media_galleries/fileapi/native_media_file_util.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/file_util.h"
+#include "base/files/file_enumerator.h"
#include "base/string_util.h"
#include "base/task_runner_util.h"
#include "chrome/browser/media_galleries/fileapi/media_file_system_mount_point_provider.h"
@@ -531,16 +532,10 @@ base::PlatformFileError NativeMediaFileUtil::ReadDirectorySync(
if (!file_info.is_directory)
return base::PLATFORM_FILE_ERROR_NOT_A_DIRECTORY;
- file_util::FileEnumerator file_enum(
+ base::FileEnumerator file_enum(
platform_path,
false /* recursive */,
- file_util::FileEnumerator::FILES |
- file_util::FileEnumerator::DIRECTORIES);
- file_util::FileEnumerator::FindInfo file_util_info;
-#if defined(OS_WIN)
- memset(&file_util_info, 0, sizeof(file_util_info));
-#endif // defined(OS_WIN)
-
+ base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES);
for (base::FilePath platform_path = file_enum.Next();
!platform_path.empty();
platform_path = file_enum.Next()) {
@@ -548,21 +543,20 @@ base::PlatformFileError NativeMediaFileUtil::ReadDirectorySync(
if (file_util::IsLink(platform_path))
continue;
- file_enum.GetFindInfo(&file_util_info);
+ base::FileEnumerator::FileInfo info = file_enum.GetInfo();
// NativeMediaFileUtil skip criteria.
if (ShouldSkip(platform_path))
continue;
- if (!file_util::FileEnumerator::IsDirectory(file_util_info) &&
+ if (!info.IsDirectory() &&
!GetMediaPathFilter(context)->Match(platform_path))
continue;
fileapi::DirectoryEntry entry;
- entry.is_directory = file_util::FileEnumerator::IsDirectory(file_util_info);
+ entry.is_directory = info.IsDirectory();
entry.name = platform_path.BaseName().value();
- entry.size = file_util::FileEnumerator::GetFilesize(file_util_info);
- entry.last_modified_time =
- file_util::FileEnumerator::GetLastModifiedTime(file_util_info);
+ entry.size = info.GetSize();
+ entry.last_modified_time = info.GetLastModifiedTime();
file_list->push_back(entry);
}
« no previous file with comments | « chrome/browser/importer/ie_importer.cc ('k') | chrome/browser/policy/config_dir_policy_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698