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

Unified Diff: chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer.cc

Issue 497673002: [fsp] Do not allow to cancel closing a file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer.cc
diff --git a/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer.cc b/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer.cc
index 81094b19c11b06b85557186a7f2d405e79099bef..51f1dac6b27fd244e9cf1a8b3eb6068b9fdda703 100644
--- a/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer.cc
+++ b/chrome/browser/chromeos/file_system_provider/fileapi/file_stream_writer.cc
@@ -59,8 +59,10 @@ class FileStreamWriter::OperationRunner
void CloseFileOnUIThread() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (file_system_.get() && file_handle_ != -1) {
- abort_callback_ = file_system_->CloseFile(
- file_handle_, base::Bind(&EmptyStatusCallback));
+ // Closing a file must not be aborted, since we could end up on files
+ // which are never closed.
+ file_system_->CloseFile(file_handle_, base::Bind(&EmptyStatusCallback));
+ abort_callback_ = ProvidedFileSystemInterface::AbortCallback();
}
}
@@ -96,12 +98,11 @@ class FileStreamWriter::OperationRunner
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (abort_callback_.is_null()) {
- // No operation on the file system being performed. At most a callback
- // call, which will be discarded.
- BrowserThread::PostTask(
- BrowserThread::IO,
- FROM_HERE,
- base::Bind(callback, base::File::FILE_ERROR_ABORT));
+ // No operation to be cancelled. At most a callback call, which will be
+ // discarded.
+ BrowserThread::PostTask(BrowserThread::IO,
+ FROM_HERE,
+ base::Bind(callback, base::File::FILE_OK));
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698