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

Unified Diff: webkit/fileapi/file_system_file_util.cc

Issue 9564047: Add FileUtileHelper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: s/DeletePath/Delete/g Created 8 years, 10 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 | « webkit/fileapi/file_system_file_util.h ('k') | webkit/fileapi/file_system_file_util_proxy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/file_system_file_util.cc
diff --git a/webkit/fileapi/file_system_file_util.cc b/webkit/fileapi/file_system_file_util.cc
index 484a3c512882ebfedf8ad4e2ea48155e4ad300a1..b542104d1569734974f967c05ebac4f15176b795 100644
--- a/webkit/fileapi/file_system_file_util.cc
+++ b/webkit/fileapi/file_system_file_util.cc
@@ -22,20 +22,6 @@ FileSystemFileUtil::FileSystemFileUtil(FileSystemFileUtil* underlying_file_util)
FileSystemFileUtil::~FileSystemFileUtil() {
}
-PlatformFileError FileSystemFileUtil::Delete(
- FileSystemOperationContext* context,
- const FileSystemPath& path,
- bool recursive) {
- if (DirectoryExists(context, path)) {
- if (!recursive)
- return DeleteSingleDirectory(context, path);
- else
- return DeleteDirectoryRecursive(context, path);
- } else {
- return DeleteFile(context, path);
- }
-}
-
PlatformFileError FileSystemFileUtil::CreateOrOpen(
FileSystemOperationContext* context,
const FileSystemPath& path, int file_flags,
@@ -246,37 +232,4 @@ PlatformFileError FileSystemFileUtil::DeleteSingleDirectory(
return base::PLATFORM_FILE_ERROR_FAILED;
}
-PlatformFileError FileSystemFileUtil::DeleteDirectoryRecursive(
- FileSystemOperationContext* context,
- const FileSystemPath& path) {
- scoped_ptr<AbstractFileEnumerator> file_enum(
- CreateFileEnumerator(context, path));
- FilePath file_path_each;
- std::stack<FilePath> directories;
- while (!(file_path_each = file_enum->Next()).empty()) {
- if (file_enum->IsDirectory()) {
- directories.push(file_path_each);
- } else {
- // DeleteFile here is the virtual overridden member function.
- PlatformFileError error = DeleteFile(
- context, path.WithInternalPath(file_path_each));
- if (error == base::PLATFORM_FILE_ERROR_NOT_FOUND)
- return base::PLATFORM_FILE_ERROR_FAILED;
- else if (error != base::PLATFORM_FILE_OK)
- return error;
- }
- }
-
- while (!directories.empty()) {
- PlatformFileError error = DeleteSingleDirectory(
- context, path.WithInternalPath(directories.top()));
- if (error == base::PLATFORM_FILE_ERROR_NOT_FOUND)
- return base::PLATFORM_FILE_ERROR_FAILED;
- else if (error != base::PLATFORM_FILE_OK)
- return error;
- directories.pop();
- }
- return DeleteSingleDirectory(context, path);
-}
-
} // namespace fileapi
« no previous file with comments | « webkit/fileapi/file_system_file_util.h ('k') | webkit/fileapi/file_system_file_util_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698