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

Unified Diff: webkit/browser/fileapi/file_system_operation_impl.cc

Issue 23537020: Fixes FileSystemOperation::Cancel behavior (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
Index: webkit/browser/fileapi/file_system_operation_impl.cc
diff --git a/webkit/browser/fileapi/file_system_operation_impl.cc b/webkit/browser/fileapi/file_system_operation_impl.cc
index 0e7b9378f43b98ee99deba157ef4061a1e78ba7c..7cae79aaf3b1045b09c1a82eab85eec77c76eaa5 100644
--- a/webkit/browser/fileapi/file_system_operation_impl.cc
+++ b/webkit/browser/fileapi/file_system_operation_impl.cc
@@ -453,8 +453,12 @@ void FileSystemOperationImpl::DidFinishOperation(
DCHECK_EQ(kOperationTruncate, pending_operation_);
StatusCallback cancel_callback = cancel_callback_;
- callback.Run(base::PLATFORM_FILE_ERROR_ABORT);
- cancel_callback.Run(base::PLATFORM_FILE_OK);
+ callback.Run(rv);
+
+ // Return OK only if we succeeded to stop the operation.
+ cancel_callback.Run(rv == base::PLATFORM_FILE_ERROR_ABORT ?
+ base::PLATFORM_FILE_OK :
+ base::PLATFORM_FILE_ERROR_INVALID_OPERATION);
} else {
callback.Run(rv);
}

Powered by Google App Engine
This is Rietveld 408576698