Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(868)

Unified Diff: webkit/fileapi/file_system_operation.h

Issue 3599011: Add truncate and cancel for FileWriter; write and tests will come in later CL... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/fileapi/file_system_callback_dispatcher.h ('k') | webkit/fileapi/file_system_operation.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/file_system_operation.h
===================================================================
--- webkit/fileapi/file_system_operation.h (revision 61078)
+++ webkit/fileapi/file_system_operation.h (working copy)
@@ -61,8 +61,7 @@
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 @@
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 @@
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);
« no previous file with comments | « webkit/fileapi/file_system_callback_dispatcher.h ('k') | webkit/fileapi/file_system_operation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698