diff options
author | ericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-05 02:26:47 +0000 |
---|---|---|
committer | ericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-05 02:26:47 +0000 |
commit | 7eb68a27b4edcf33b6f8edeb5a133d7397409cd8 (patch) | |
tree | 938b6749fcf8a831b2cd8cd882adb00773c3b034 /webkit/fileapi/file_system_operation.h | |
parent | d5cdb124950adf17d37aafe3d5187f94081921cd (diff) | |
download | chromium_src-7eb68a27b4edcf33b6f8edeb5a133d7397409cd8.zip chromium_src-7eb68a27b4edcf33b6f8edeb5a133d7397409cd8.tar.gz chromium_src-7eb68a27b4edcf33b6f8edeb5a133d7397409cd8.tar.bz2 |
Second try at submitting 61462.
BUG=none
TEST=in file_system_operation_unittest.cc
Review URL: http://codereview.chromium.org/3526018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61468 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/file_system_operation.h')
-rw-r--r-- | webkit/fileapi/file_system_operation.h | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/webkit/fileapi/file_system_operation.h b/webkit/fileapi/file_system_operation.h index 1107303..ab6d56c 100644 --- a/webkit/fileapi/file_system_operation.h +++ b/webkit/fileapi/file_system_operation.h @@ -61,8 +61,7 @@ class FileSystemOperation { void Remove(const FilePath& path); - void Write( - const FilePath& path, const GURL& blob_url, int64 offset); + void Write(const FilePath& path, const GURL& blob_url, int64 offset); void Truncate(const FilePath& path, int64 length); @@ -70,9 +69,10 @@ class FileSystemOperation { const base::Time& last_access_time, const base::Time& last_modified_time); - // Used to attempt to cancel the current operation. This currently does - // nothing for any operation other than Write(). - void Cancel(); + // 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); protected: // Proxy for calling file_util_proxy methods. @@ -114,9 +114,28 @@ class FileSystemOperation { base::ScopedCallbackFactory<FileSystemOperation> callback_factory_; + 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. - bool operation_pending_; + OperationType pending_operation_; #endif DISALLOW_COPY_AND_ASSIGN(FileSystemOperation); |