| Index: webkit/fileapi/local_file_system_operation.h
|
| diff --git a/webkit/fileapi/local_file_system_operation.h b/webkit/fileapi/local_file_system_operation.h
|
| index fafaca642fad18fb96990217e373d252c2ab1592..d5f33d85940299124a5b07522dbce8de64113808 100644
|
| --- a/webkit/fileapi/local_file_system_operation.h
|
| +++ b/webkit/fileapi/local_file_system_operation.h
|
| @@ -25,7 +25,7 @@ class CrosMountPointProvider;
|
| namespace fileapi {
|
|
|
| class FileSystemContext;
|
| -class RemoveOperationDelegate;
|
| +class RecursiveOperationDelegate;
|
|
|
| // FileSystemOperation implementation for local file systems.
|
| class WEBKIT_STORAGE_EXPORT LocalFileSystemOperation
|
| @@ -112,6 +112,40 @@ class WEBKIT_STORAGE_EXPORT LocalFileSystemOperation
|
| void RemoveDirectory(const FileSystemURL& url,
|
| const StatusCallback& callback);
|
|
|
| + // Copies a file from |src_url| to |dest_url|.
|
| + // This must be called for files that belong to the same filesystem
|
| + // (i.e. type() and origin() of the |src_url| and |dest_url| must match).
|
| + //
|
| + // This returns:
|
| + // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_url|
|
| + // or the parent directory of |dest_url| does not exist.
|
| + // - PLATFORM_FILE_ERROR_NOT_A_FILE if |src_url| exists but is not a file.
|
| + // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and
|
| + // is not a file.
|
| + // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and
|
| + // its parent path is a file.
|
| + //
|
| + void CopyFileLocal(const FileSystemURL& src_url,
|
| + const FileSystemURL& dest_url,
|
| + const StatusCallback& callback);
|
| +
|
| + // Moves a local file from |src_url| to |dest_url|.
|
| + // This must be called for files that belong to the same filesystem
|
| + // (i.e. type() and origin() of the |src_url| and |dest_url| must match).
|
| + //
|
| + // This returns:
|
| + // - PLATFORM_FILE_ERROR_NOT_FOUND if |src_url|
|
| + // or the parent directory of |dest_url| does not exist.
|
| + // - PLATFORM_FILE_ERROR_NOT_A_FILE if |src_url| exists but is not a file.
|
| + // - PLATFORM_FILE_ERROR_INVALID_OPERATION if |dest_url| exists and
|
| + // is not a file.
|
| + // - PLATFORM_FILE_ERROR_FAILED if |dest_url| does not exist and
|
| + // its parent path is a file.
|
| + //
|
| + void MoveFileLocal(const FileSystemURL& src_url,
|
| + const FileSystemURL& dest_url,
|
| + const StatusCallback& callback);
|
| +
|
| // Synchronously gets the platform path for the given |url|.
|
| void SyncGetPlatformPath(const FileSystemURL& url, FilePath* platform_path);
|
|
|
| @@ -138,7 +172,8 @@ class WEBKIT_STORAGE_EXPORT LocalFileSystemOperation
|
| friend class FileSystemQuotaTest;
|
| friend class LocalFileSystemTestOriginHelper;
|
|
|
| - friend class RemoveOperationDelegate;
|
| + friend class RecursiveOperationDelegate;
|
| + friend class CrossOperationDelegate;
|
| friend class SyncableFileSystemOperation;
|
|
|
| LocalFileSystemOperation(
|
| @@ -192,15 +227,15 @@ class WEBKIT_STORAGE_EXPORT LocalFileSystemOperation
|
| const StatusCallback& callback,
|
| bool exclusive,
|
| bool recursive);
|
| - void DoCopy(const FileSystemURL& src,
|
| - const FileSystemURL& dest,
|
| - const StatusCallback& callback);
|
| + void DoCopyFileLocal(const FileSystemURL& src,
|
| + const FileSystemURL& dest,
|
| + const StatusCallback& callback);
|
| + void DoMoveFileLocal(const FileSystemURL& src,
|
| + const FileSystemURL& dest,
|
| + const StatusCallback& callback);
|
| void DoCopyInForeignFile(const FilePath& src_local_disk_file_path,
|
| const FileSystemURL& dest,
|
| const StatusCallback& callback);
|
| - void DoMove(const FileSystemURL& src,
|
| - const FileSystemURL& dest,
|
| - const StatusCallback& callback);
|
| void DoTruncate(const FileSystemURL& url,
|
| const StatusCallback& callback, int64 length);
|
| void DoOpenFile(const FileSystemURL& url,
|
| @@ -286,18 +321,13 @@ class WEBKIT_STORAGE_EXPORT LocalFileSystemOperation
|
| scoped_refptr<FileSystemContext> file_system_context_;
|
|
|
| scoped_ptr<FileSystemOperationContext> operation_context_;
|
| - FileSystemFileUtil* src_util_; // Not owned.
|
| - FileSystemFileUtil* dest_util_; // Not owned.
|
| + FileSystemFileUtil* file_util_; // Not owned.
|
|
|
| FileSystemOperationContext* overriding_operation_context_;
|
|
|
| // A callback that is called when this instance goes away.
|
| base::Closure termination_callback_;
|
|
|
| - // Indicates if this operation is for cross filesystem operation or not.
|
| - // TODO(kinuko): This should be cleaned up.
|
| - bool is_cross_operation_;
|
| -
|
| // This is set before any write operations to dispatch
|
| // FileUpdateObserver::StartUpdate and FileUpdateObserver::EndUpdate.
|
| ScopedVector<ScopedUpdateNotifier> scoped_update_notifiers_;
|
| @@ -306,7 +336,7 @@ class WEBKIT_STORAGE_EXPORT LocalFileSystemOperation
|
| friend class FileWriterDelegate;
|
| scoped_ptr<FileWriterDelegate> file_writer_delegate_;
|
|
|
| - scoped_ptr<RemoveOperationDelegate> remove_operation_delegate_;
|
| + scoped_ptr<RecursiveOperationDelegate> recursive_operation_delegate_;
|
|
|
| // write_callback is kept in this class for so that we can dispatch it when
|
| // the operation is cancelled. calcel_callback is kept for canceling a
|
|
|