Chromium Code Reviews| Index: webkit/fileapi/local_file_system_operation.cc |
| diff --git a/webkit/fileapi/local_file_system_operation.cc b/webkit/fileapi/local_file_system_operation.cc |
| index ff46be532199a57d370f4c7b080206d6aa826091..ab6f19f494a064ddcf7d074e6bc2035fe5fc5ba9 100644 |
| --- a/webkit/fileapi/local_file_system_operation.cc |
| +++ b/webkit/fileapi/local_file_system_operation.cc |
| @@ -314,7 +314,7 @@ void LocalFileSystemOperation::Write( |
| DCHECK(blob_url.is_valid()); |
| file_writer_delegate_.reset(new FileWriterDelegate( |
| base::Bind(&LocalFileSystemOperation::DidWrite, |
| - weak_factory_.GetWeakPtr()), |
| + weak_factory_.GetWeakPtr(), url), |
| writer.Pass())); |
| set_write_callback(callback); |
| @@ -677,15 +677,23 @@ void LocalFileSystemOperation::DidReadDirectory( |
| } |
| void LocalFileSystemOperation::DidWrite( |
| + const FileSystemURL& url, |
| base::PlatformFileError rv, |
| int64 bytes, |
| - bool complete) { |
| + FileWriterDelegate::WriteProgressStatus write_status) { |
| if (write_callback_.is_null()) { |
| // If cancelled, callback is already invoked and set to null in Cancel(). |
| // We must not call it twice. Just shut down this operation object. |
| delete this; |
| return; |
| } |
| + |
| + bool complete = (write_status != FileWriterDelegate::SUCCESS_IO_PENDING); |
|
kinuko
2012/09/26 06:31:15
nit: const
calvinlo
2012/09/26 07:43:40
Done.
|
| + if (complete && write_status != FileWriterDelegate::ERROR_WRITE_NOT_STARTED) { |
| + operation_context_->change_observers()->Notify( |
| + &FileChangeObserver::OnModifyFile, MakeTuple(url)); |
| + } |
| + |
| write_callback_.Run(rv, bytes, complete); |
| if (complete || rv != base::PLATFORM_FILE_OK) |
| delete this; |