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

Unified Diff: webkit/fileapi/file_system_file_util_proxy.h

Issue 12051010: (For-try) Divide recursive Copy/Move into multiple async tasks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test fix 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
Index: webkit/fileapi/file_system_file_util_proxy.h
diff --git a/webkit/fileapi/file_system_file_util_proxy.h b/webkit/fileapi/file_system_file_util_proxy.h
index 654fbf913f0a794dc24b9959b6a381ea5b6486ee..54c6feed3c99a314ed07895ad80feeb93e367c2c 100644
--- a/webkit/fileapi/file_system_file_util_proxy.h
+++ b/webkit/fileapi/file_system_file_util_proxy.h
@@ -41,13 +41,18 @@ class FileSystemFileUtilProxy {
FileSystemFileUtil::SnapshotFilePolicy snapshot_policy)>
SnapshotFileCallback;
- // Deletes a file or a directory on the given context's task_runner.
- // It is an error to delete a non-empty directory with recursive=false.
- static bool Delete(
+ // Deletes a file on the given context's task_runner.
+ static bool DeleteFile(
+ FileSystemOperationContext* context,
+ FileSystemFileUtil* file_util,
+ const FileSystemURL& url,
+ const StatusCallback& callback);
+
+ // Deletes a directory on the given context's task_runner.
+ static bool DeleteDirectory(
FileSystemOperationContext* context,
FileSystemFileUtil* file_util,
const FileSystemURL& url,
- bool recursive,
const StatusCallback& callback);
// Creates or opens a file with the given flags by calling |file_util|'s
@@ -59,48 +64,28 @@ class FileSystemFileUtilProxy {
int file_flags,
const CreateOrOpenCallback& callback);
- // Copies a file or a directory from |src_url| to |dest_url| by calling
- // FileSystemFileUtil's following methods on the given context's
- // task_runner.
- // - CopyOrMoveFile() for same-filesystem operations
- // - CopyInForeignFile() for (limited) cross-filesystem operations
- //
- // Error cases:
- // If destination's parent doesn't exist.
- // If source dir exists but destination url is an existing file.
- // If source file exists but destination url is an existing directory.
- // If source is a parent of destination.
- // If source doesn't exist.
- // If source and dest are the same url in the same filesystem.
- static bool Copy(
+ // Copies a local file or a directory from |src_url| to |dest_url|.
+ static bool CopyLocalFile(
FileSystemOperationContext* context,
- FileSystemFileUtil* src_util,
- FileSystemFileUtil* dest_util,
+ FileSystemFileUtil* file_util,
const FileSystemURL& src_url,
const FileSystemURL& dest_url,
const StatusCallback& callback);
- // Copies a file from local disk to the given filesystem destination.
- // Primarily used for the Syncable filesystem type (e.g. GDrive).
- static bool CopyInForeignFile(
+ // Moves a local file or a directory from |src_url| to |dest_url|.
+ static bool MoveLocalFile(
FileSystemOperationContext* context,
- FileSystemFileUtil* dest_util,
- const FilePath& src_local_disk_file_path,
+ FileSystemFileUtil* file_util,
+ const FileSystemURL& src_url,
const FileSystemURL& dest_url,
const StatusCallback& callback);
- // Moves a file or a directory from |src_url| to |dest_url| by calling
- // FileSystemFileUtil's following methods on the given context's
- // task_runner.
- // - CopyOrMoveFile() for same-filesystem operations
- // - CopyInForeignFile() for (limited) cross-filesystem operations
- //
- // This method returns an error on the same error cases with Copy.
- static bool Move(
+ // Copies a file from local disk to the given filesystem destination.
+ // Primarily used for the Syncable filesystem type (e.g. GDrive).
+ static bool CopyInForeignFile(
FileSystemOperationContext* context,
- FileSystemFileUtil* src_util,
- FileSystemFileUtil* dest_util,
- const FileSystemURL& src_url,
+ FileSystemFileUtil* file_util,
+ const FilePath& src_local_disk_file_path,
const FileSystemURL& dest_url,
const StatusCallback& callback);

Powered by Google App Engine
This is Rietveld 408576698