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

Unified Diff: webkit/fileapi/syncable/syncable_file_system_operation.cc

Issue 12051055: 2nd try: FileAPI: Split recursive remove into multiple tasks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 11 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/syncable/syncable_file_system_operation.h ('k') | webkit/fileapi/webkit_fileapi.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/syncable/syncable_file_system_operation.cc
diff --git a/webkit/fileapi/syncable/syncable_file_system_operation.cc b/webkit/fileapi/syncable/syncable_file_system_operation.cc
index 8954f26d37bd92dd43eff3a12043ec5addfd4027..03875357c6ce6960834620286061668cebf8058b 100644
--- a/webkit/fileapi/syncable/syncable_file_system_operation.cc
+++ b/webkit/fileapi/syncable/syncable_file_system_operation.cc
@@ -314,8 +314,14 @@ void SyncableFileSystemOperation::Cancel(
LocalFileSystemOperation*
SyncableFileSystemOperation::AsLocalFileSystemOperation() {
- NOTREACHED();
- return NULL;
+ // This must be called for nested sub-task operations
+ // where we don't need extra task queueing.
+ // Just return the internal file_system_operation_ and let this
+ // instance goes away when the operation dies.
+ file_system_operation_->set_termination_callback(
+ base::Bind(&SyncableFileSystemOperation::Destruct,
+ base::Unretained(this)));
+ return file_system_operation_;
}
void SyncableFileSystemOperation::CreateSnapshotFile(
@@ -388,4 +394,8 @@ void SyncableFileSystemOperation::AbortOperation(
delete this;
}
+void SyncableFileSystemOperation::Destruct() {
+ delete this;
+}
+
} // namespace fileapi
« no previous file with comments | « webkit/fileapi/syncable/syncable_file_system_operation.h ('k') | webkit/fileapi/webkit_fileapi.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698