Index: webkit/fileapi/file_system_operation_interface.h |
diff --git a/webkit/fileapi/file_system_operation_interface.h b/webkit/fileapi/file_system_operation_interface.h |
index 033abead4ec07aa9c34f4f887759370d304b8fe0..f9018f17e47c06cbbd97db0aa19d4ebbe7c1a7ae 100644 |
--- a/webkit/fileapi/file_system_operation_interface.h |
+++ b/webkit/fileapi/file_system_operation_interface.h |
@@ -20,6 +20,8 @@ class GURL; |
namespace fileapi { |
+class FileSystemCallbackDispatcher; |
+ |
// The interface class for FileSystemOperation implementations. |
// |
// This interface defines file system operations required to implement |
@@ -46,12 +48,6 @@ class FileSystemOperationInterface { |
public: |
virtual ~FileSystemOperationInterface() {} |
- // Opens a file system at |origin_url| of the |type|. Creates a new file |
- // system if |create| is true. |
- virtual void OpenFileSystem(const GURL& origin_url, |
- fileapi::FileSystemType type, |
- bool create) = 0; |
- |
// Creates a file at |path|. If |exclusive| is true, an error is raised |
// in case a file is already present at the URL. |
virtual void CreateFile(const GURL& path, |
@@ -105,6 +101,30 @@ class FileSystemOperationInterface { |
// part is filled with null bytes. |
virtual void Truncate(const GURL& path, int64 length) = 0; |
+ // Tries to cancel the current operation [we support cancelling write or |
+ // truncate only]. Reports failure for the current operation, then reports |
+ // success for the cancel operation itself via the |cancel_dispatcher|. |
+ // |
+ // E.g. a typical cancel implementation would look like: |
+ // |
+ // virtual void SomeOperationImpl::Cancel( |
+ // scoped_ptr<FileSystemCallbackDispatcher> cancel_dispatcher) { |
+ // // Abort the current inflight operation first. |
+ // ... |
+ // |
+ // // Dispatch ABORT error for the current operation by calling |
+ // // DidFail() callback of the dispatcher attached to this operation. |
+ // // (dispatcher_ in this example) |
+ // dispatcher_->DidFail(base::PLATFORM_FILE_ERROR_ABORT); |
+ // |
+ // // Dispatch 'success' for the cancel (or dispatch appropriate |
+ // // error code with DidFail() if the cancel has somehow failed). |
+ // cancel_dispatcher->DidSucceed(); |
+ // } |
+ // |
+ virtual void Cancel( |
+ scoped_ptr<FileSystemCallbackDispatcher> cancel_dispatcher) = 0; |
+ |
// Modifies timestamps of a file or directory at |path| with |
// |last_access_time| and |last_modified_time|. The function DOES NOT |
// create a file unlike 'touch' command on Linux. |