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

Unified Diff: webkit/fileapi/local_file_util.cc

Issue 11960003: Cleanup: Move more recursive operation logic from FileUtilHelper to FileUtil (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 11 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/local_file_util.h ('k') | webkit/fileapi/media/device_media_file_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/local_file_util.cc
diff --git a/webkit/fileapi/local_file_util.cc b/webkit/fileapi/local_file_util.cc
index 2e47094e76d9bc28e933be91ed9de9f2a62244f6..2cae13605673ced88ec0cfb5683af36c877fecb1 100644
--- a/webkit/fileapi/local_file_util.cc
+++ b/webkit/fileapi/local_file_util.cc
@@ -191,15 +191,6 @@ PlatformFileError LocalFileUtil::Truncate(
return NativeFileUtil::Truncate(file_path, length);
}
-bool LocalFileUtil::IsDirectoryEmpty(
- FileSystemOperationContext* context,
- const FileSystemURL& url) {
- FilePath file_path;
- if (GetLocalFilePath(context, url, &file_path) != base::PLATFORM_FILE_OK)
- return true;
- return NativeFileUtil::IsDirectoryEmpty(file_path);
-}
-
PlatformFileError LocalFileUtil::CopyOrMoveFile(
FileSystemOperationContext* context,
const FileSystemURL& src_url,
@@ -218,7 +209,6 @@ PlatformFileError LocalFileUtil::CopyOrMoveFile(
return NativeFileUtil::CopyOrMoveFile(src_file_path, dest_file_path, copy);
}
-// TODO(dmikurube): Make it independent from CopyOrMoveFile.
PlatformFileError LocalFileUtil::CopyInForeignFile(
FileSystemOperationContext* context,
const FilePath& src_file_path,
@@ -244,14 +234,14 @@ PlatformFileError LocalFileUtil::DeleteFile(
return NativeFileUtil::DeleteFile(file_path);
}
-PlatformFileError LocalFileUtil::DeleteSingleDirectory(
+PlatformFileError LocalFileUtil::DeleteDirectory(
FileSystemOperationContext* context,
const FileSystemURL& url) {
FilePath file_path;
PlatformFileError error = GetLocalFilePath(context, url, &file_path);
if (error != base::PLATFORM_FILE_OK)
return error;
- return NativeFileUtil::DeleteSingleDirectory(file_path);
+ return NativeFileUtil::DeleteDirectory(file_path);
}
base::PlatformFileError LocalFileUtil::CreateSnapshotFile(
@@ -261,9 +251,14 @@ base::PlatformFileError LocalFileUtil::CreateSnapshotFile(
FilePath* platform_path,
SnapshotFilePolicy* policy) {
DCHECK(policy);
+ DCHECK(file_info);
// We're just returning the local file information.
*policy = kSnapshotFileLocal;
- return GetFileInfo(context, url, file_info, platform_path);
+ base::PlatformFileError error =
+ GetFileInfo(context, url, file_info, platform_path);
+ if (error == base::PLATFORM_FILE_OK && file_info->is_directory)
+ return base::PLATFORM_FILE_ERROR_NOT_A_FILE;
+ return error;
}
} // namespace fileapi
« no previous file with comments | « webkit/fileapi/local_file_util.h ('k') | webkit/fileapi/media/device_media_file_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698