summaryrefslogtreecommitdiffstats
path: root/chrome/browser/file_system
diff options
context:
space:
mode:
authorericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-05 01:24:51 +0000
committerericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-05 01:24:51 +0000
commit43fad839433bfa7561f86e0f4629f5a9b2b31b3e (patch)
tree4596d8a7f4bb5e39c927d1cb8fde338779c3401f /chrome/browser/file_system
parent23e2619fc7d0a817dd2f44a704b23cbac97c79da (diff)
downloadchromium_src-43fad839433bfa7561f86e0f4629f5a9b2b31b3e.zip
chromium_src-43fad839433bfa7561f86e0f4629f5a9b2b31b3e.tar.gz
chromium_src-43fad839433bfa7561f86e0f4629f5a9b2b31b3e.tar.bz2
Add truncate and cancel for FileWriter; write and more tests will come in later CLs.
This CL also contains a fair amount of plumbing for the write call itself. BUG=none TEST=none Review URL: http://codereview.chromium.org/3599011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61462 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/file_system')
-rw-r--r--chrome/browser/file_system/file_system_dispatcher_host.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/file_system/file_system_dispatcher_host.cc b/chrome/browser/file_system/file_system_dispatcher_host.cc
index 18daec8..6dd6072 100644
--- a/chrome/browser/file_system/file_system_dispatcher_host.cc
+++ b/chrome/browser/file_system/file_system_dispatcher_host.cc
@@ -238,9 +238,11 @@ void FileSystemDispatcherHost::OnCancel(
fileapi::FileSystemOperation* write =
operations_.Lookup(request_id_to_cancel);
if (write) {
- write->Cancel();
- Send(new ViewMsg_FileSystem_DidSucceed(request_id));
+ // The cancel will eventually send both the write failure and the cancel
+ // success.
+ write->Cancel(GetNewOperation(request_id));
} else {
+ // The write already finished; report that we failed to stop it.
Send(new ViewMsg_FileSystem_DidFail(
request_id, base::PLATFORM_FILE_ERROR_INVALID_OPERATION));
}