diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-08 04:53:36 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-08 04:53:36 +0000 |
commit | 25a4c1ccaee2b032ee368d733b79ac814efd7c37 (patch) | |
tree | 589cd0233167acf4a3fe7bdaf50cea24ad505b7b /webkit/browser/fileapi/sandbox_directory_database.cc | |
parent | aff39ac8a8ea09920b9180ebc09d72c15832f3ad (diff) | |
download | chromium_src-25a4c1ccaee2b032ee368d733b79ac814efd7c37.zip chromium_src-25a4c1ccaee2b032ee368d733b79ac814efd7c37.tar.gz chromium_src-25a4c1ccaee2b032ee368d733b79ac814efd7c37.tar.bz2 |
Move FileEnumerator to its own file, do some refactoring.
It creates a class FileInfo to contain the details rather than using a platform-specific typedef. This allows the accessors GetName, GetSize, etc. to be moved directly to this class (previously they were static helpers on the FileEnumerator class) which makes a bunch of code much cleaner. It also gives reasonable getting and initialization which the previous version lacked.
BUG=175002
Reland of 198820 and 298824
Original review = https://codereview.chromium.org/13165005
R=rvargas@chromium.org
Review URL: https://codereview.chromium.org/16392011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205019 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/browser/fileapi/sandbox_directory_database.cc')
-rw-r--r-- | webkit/browser/fileapi/sandbox_directory_database.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/webkit/browser/fileapi/sandbox_directory_database.cc b/webkit/browser/fileapi/sandbox_directory_database.cc index 6af02ab..b5b30d8 100644 --- a/webkit/browser/fileapi/sandbox_directory_database.cc +++ b/webkit/browser/fileapi/sandbox_directory_database.cc @@ -10,6 +10,7 @@ #include <stack> #include "base/file_util.h" +#include "base/files/file_enumerator.h" #include "base/location.h" #include "base/metrics/histogram.h" #include "base/pickle.h" @@ -282,16 +283,14 @@ bool DatabaseCheckHelper::ScanDirectory() { base::FilePath dir_path = pending_directories.top(); pending_directories.pop(); - file_util::FileEnumerator file_enum( + base::FileEnumerator file_enum( dir_path.empty() ? path_ : path_.Append(dir_path), false /* not recursive */, - file_util::FileEnumerator::DIRECTORIES | - file_util::FileEnumerator::FILES); + base::FileEnumerator::DIRECTORIES | base::FileEnumerator::FILES); base::FilePath absolute_file_path; while (!(absolute_file_path = file_enum.Next()).empty()) { - file_util::FileEnumerator::FindInfo find_info; - file_enum.GetFindInfo(&find_info); + base::FileEnumerator::FileInfo find_info = file_enum.GetInfo(); base::FilePath relative_file_path; if (!path_.AppendRelativePath(absolute_file_path, &relative_file_path)) @@ -301,7 +300,7 @@ bool DatabaseCheckHelper::ScanDirectory() { relative_file_path) != kExcludes + arraysize(kExcludes)) continue; - if (file_util::FileEnumerator::IsDirectory(find_info)) { + if (find_info.IsDirectory()) { pending_directories.push(relative_file_path); continue; } |