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

Unified Diff: webkit/fileapi/webfilewriter_base.cc

Issue 14796018: Cleanup: Deprecate FileSystemCallbackDispatcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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/webfilewriter_base.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/webfilewriter_base.cc
diff --git a/webkit/fileapi/webfilewriter_base.cc b/webkit/fileapi/webfilewriter_base.cc
index ca0239f57ed5c8ac1074997a48ef9ebd405ffb4b..cd0bd7575999b7ce0e1f0935c553cfeb0d836518 100644
--- a/webkit/fileapi/webfilewriter_base.cc
+++ b/webkit/fileapi/webfilewriter_base.cc
@@ -63,6 +63,34 @@ void WebFileWriterBase::cancel() {
DoCancel();
}
+void WebFileWriterBase::DidFinish(base::PlatformFileError error_code) {
+ if (error_code == base::PLATFORM_FILE_OK)
+ DidSucceed();
+ else
+ DidFail(error_code);
+}
+
+void WebFileWriterBase::DidWrite(int64 bytes, bool complete) {
+ DCHECK(kOperationWrite == operation_);
+ switch (cancel_state_) {
+ case kCancelNotInProgress:
+ if (complete)
+ operation_ = kOperationNone;
+ client_->didWrite(bytes, complete);
+ break;
+ case kCancelSent:
+ // This is the success call of the write, which we'll eat, even though
+ // it succeeded before the cancel got there. We accepted the cancel call,
+ // so the write will eventually return an error.
+ if (complete)
+ cancel_state_ = kCancelReceivedWriteResponse;
+ break;
+ case kCancelReceivedWriteResponse:
+ default:
+ NOTREACHED();
+ }
+}
+
void WebFileWriterBase::DidSucceed() {
// Write never gets a DidSucceed call, so this is either a cancel or truncate
// response.
@@ -115,27 +143,6 @@ void WebFileWriterBase::DidFail(base::PlatformFileError error_code) {
}
}
-void WebFileWriterBase::DidWrite(int64 bytes, bool complete) {
- DCHECK(kOperationWrite == operation_);
- switch (cancel_state_) {
- case kCancelNotInProgress:
- if (complete)
- operation_ = kOperationNone;
- client_->didWrite(bytes, complete);
- break;
- case kCancelSent:
- // This is the success call of the write, which we'll eat, even though
- // it succeeded before the cancel got there. We accepted the cancel call,
- // so the write will eventually return an error.
- if (complete)
- cancel_state_ = kCancelReceivedWriteResponse;
- break;
- case kCancelReceivedWriteResponse:
- default:
- NOTREACHED();
- }
-}
-
void WebFileWriterBase::FinishCancel() {
DCHECK(kCancelReceivedWriteResponse == cancel_state_);
DCHECK(kOperationNone != operation_);
« no previous file with comments | « webkit/fileapi/webfilewriter_base.h ('k') | webkit/fileapi/webkit_fileapi.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698