diff options
author | hidehiko@chromium.org <hidehiko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-01 20:15:36 +0000 |
---|---|---|
committer | hidehiko@chromium.org <hidehiko@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-01 20:15:36 +0000 |
commit | ef1cc9f16bd833004cf068403df32c1dcc28d3b2 (patch) | |
tree | a6273d70d344cf21da91b6bc11926ef8c74b6eb0 /webkit/browser/fileapi/async_file_util.h | |
parent | eda043155d9309d20bfa50aedafce1280b20782f (diff) | |
download | chromium_src-ef1cc9f16bd833004cf068403df32c1dcc28d3b2.zip chromium_src-ef1cc9f16bd833004cf068403df32c1dcc28d3b2.tar.gz chromium_src-ef1cc9f16bd833004cf068403df32c1dcc28d3b2.tar.bz2 |
Add DeleteRecursively to AsyncFileUtil.
On Drive file system, recursive deletion can be done more efficiently than
removing each file/directory. To support it, this CL adds an optional method
DeleteRecursively to AsyncFileUtil, and use it (if possible) in
LocalFileSystemOperation.
This is the preparation of merging {Remote,Local}FileSystemOperation. Currently
the new method is not used on any platforms, but will be used by Drive File
System.
BUG=110121
TEST=Ran unit_tests
Review URL: https://chromiumcodereview.appspot.com/18314002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209484 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/browser/fileapi/async_file_util.h')
-rw-r--r-- | webkit/browser/fileapi/async_file_util.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/webkit/browser/fileapi/async_file_util.h b/webkit/browser/fileapi/async_file_util.h index 922bbfc..141d8cf 100644 --- a/webkit/browser/fileapi/async_file_util.h +++ b/webkit/browser/fileapi/async_file_util.h @@ -296,6 +296,26 @@ class WEBKIT_STORAGE_BROWSER_EXPORT AsyncFileUtil { const FileSystemURL& url, const StatusCallback& callback) = 0; + // Removes a single file or a single directory with its contents + // (i.e. files/subdirectories under the directory). + // + // LocalFileSystemOperation::Remove calls this. + // On some platforms, such as Chrome OS Drive File System, recursive file + // deletion can be implemented more efficiently than calling DeleteFile() and + // DeleteDirectory() for each files/directories. + // This method is optional, so if not supported, + // PLATFORM_ERROR_INVALID_OPERATION should be returned via |callback|. + // + // This returns false if it fails to post an async task. + // + // This reports following error code via |callback|: + // - PLATFORM_FILE_ERROR_NOT_FOUND if |url| does not exist. + // - PLATFORM_ERROR_INVALID_OPERATION if this operation is not supported. + virtual bool DeleteRecursively( + scoped_ptr<FileSystemOperationContext> context, + const FileSystemURL& url, + const StatusCallback& callback) = 0; + // Creates a local snapshot file for a given |url| and returns the // metadata and platform path of the snapshot file via |callback|. // In regular filesystem cases the implementation may simply return |