| Index: webkit/fileapi/file_system_operation.h
|
| diff --git a/webkit/fileapi/file_system_operation.h b/webkit/fileapi/file_system_operation.h
|
| index d76513f37ead22a8934f8477192cb9fce0ae8267..01e2da1853c6dbeba2f55494a71137b6ee7f9b27 100644
|
| --- a/webkit/fileapi/file_system_operation.h
|
| +++ b/webkit/fileapi/file_system_operation.h
|
| @@ -37,49 +37,70 @@ class FileSystemOperation {
|
| public:
|
| FileSystemOperation(FileSystemCallbackDispatcher* dispatcher,
|
| scoped_refptr<base::MessageLoopProxy> proxy);
|
| - ~FileSystemOperation();
|
| + virtual ~FileSystemOperation();
|
|
|
| - void CreateFile(const FilePath& path,
|
| - bool exclusive);
|
| + virtual void CreateFile(const FilePath& path,
|
| + bool exclusive);
|
|
|
| - void CreateDirectory(const FilePath& path,
|
| - bool exclusive,
|
| - bool recursive);
|
| + virtual void CreateDirectory(const FilePath& path,
|
| + bool exclusive,
|
| + bool recursive);
|
|
|
| - void Copy(const FilePath& src_path,
|
| - const FilePath& dest_path);
|
| + virtual void Copy(const FilePath& src_path,
|
| + const FilePath& dest_path);
|
|
|
| - void Move(const FilePath& src_path,
|
| - const FilePath& dest_path);
|
| + virtual void Move(const FilePath& src_path,
|
| + const FilePath& dest_path);
|
|
|
| - void DirectoryExists(const FilePath& path);
|
| + virtual void DirectoryExists(const FilePath& path);
|
|
|
| - void FileExists(const FilePath& path);
|
| + virtual void FileExists(const FilePath& path);
|
|
|
| - void GetMetadata(const FilePath& path);
|
| + virtual void GetMetadata(const FilePath& path);
|
|
|
| - void ReadDirectory(const FilePath& path);
|
| + virtual void ReadDirectory(const FilePath& path);
|
|
|
| - void Remove(const FilePath& path, bool recursive);
|
| + virtual void Remove(const FilePath& path, bool recursive);
|
|
|
| - void Write(
|
| + virtual void Write(
|
| scoped_refptr<URLRequestContext> url_request_context,
|
| const FilePath& path, const GURL& blob_url, int64 offset);
|
|
|
| - void Truncate(const FilePath& path, int64 length);
|
| + virtual void Truncate(const FilePath& path, int64 length);
|
|
|
| - void TouchFile(const FilePath& path,
|
| + virtual void TouchFile(const FilePath& path,
|
| const base::Time& last_access_time,
|
| const base::Time& last_modified_time);
|
|
|
| // Try to cancel the current operation [we support cancelling write or
|
| // truncate only]. Report failure for the current operation, then tell the
|
| // passed-in operation to report success.
|
| - void Cancel(FileSystemOperation* cancel_operation);
|
| + virtual void Cancel(FileSystemOperation* cancel_operation);
|
|
|
| protected:
|
| - // Proxy for calling file_util_proxy methods.
|
| - scoped_refptr<base::MessageLoopProxy> proxy_;
|
| +#ifndef NDEBUG
|
| + enum OperationType {
|
| + kOperationNone,
|
| + kOperationCreateFile,
|
| + kOperationCreateDirectory,
|
| + kOperationCopy,
|
| + kOperationMove,
|
| + kOperationDirectoryExists,
|
| + kOperationFileExists,
|
| + kOperationGetMetadata,
|
| + kOperationReadDirectory,
|
| + kOperationRemove,
|
| + kOperationWrite,
|
| + kOperationTruncate,
|
| + kOperationTouchFile,
|
| + kOperationCancel,
|
| + };
|
| +
|
| + // A flag to make sure we call operation only once per instance.
|
| + OperationType pending_operation_;
|
| +#endif
|
| +
|
| + FileSystemCallbackDispatcher* dispatcher() const { return dispatcher_.get(); }
|
|
|
| private:
|
| // Callback for CreateFile for |exclusive|=true cases.
|
| @@ -119,7 +140,11 @@ class FileSystemOperation {
|
| base::PassPlatformFile file,
|
| bool created);
|
|
|
| + // Proxy for calling file_util_proxy methods.
|
| + scoped_refptr<base::MessageLoopProxy> proxy_;
|
| +
|
| scoped_ptr<FileSystemCallbackDispatcher> dispatcher_;
|
| +
|
| base::ScopedCallbackFactory<FileSystemOperation> callback_factory_;
|
|
|
| // These are all used only by Write().
|
| @@ -128,28 +153,6 @@ class FileSystemOperation {
|
| scoped_ptr<URLRequest> blob_request_;
|
| FileSystemOperation* cancel_operation_;
|
|
|
| -#ifndef NDEBUG
|
| - enum OperationType {
|
| - kOperationNone,
|
| - kOperationCreateFile,
|
| - kOperationCreateDirectory,
|
| - kOperationCopy,
|
| - kOperationMove,
|
| - kOperationDirectoryExists,
|
| - kOperationFileExists,
|
| - kOperationGetMetadata,
|
| - kOperationReadDirectory,
|
| - kOperationRemove,
|
| - kOperationWrite,
|
| - kOperationTruncate,
|
| - kOperationTouchFile,
|
| - kOperationCancel,
|
| - };
|
| -
|
| - // A flag to make sure we call operation only once per instance.
|
| - OperationType pending_operation_;
|
| -#endif
|
| -
|
| DISALLOW_COPY_AND_ASSIGN(FileSystemOperation);
|
| };
|
|
|
|
|