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 |