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

Unified Diff: webkit/fileapi/file_system_operation.cc

Issue 3440021: This is the IPC and bits of the browser backend for FileWriter. The rest of... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 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/file_system_operation.h ('k') | webkit/tools/test_shell/simple_file_system.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/file_system_operation.cc
===================================================================
--- webkit/fileapi/file_system_operation.cc (revision 60387)
+++ webkit/fileapi/file_system_operation.cc (working copy)
@@ -4,6 +4,7 @@
#include "webkit/fileapi/file_system_operation.h"
+#include "googleurl/src/gurl.h"
#include "webkit/fileapi/file_system_callback_dispatcher.h"
namespace fileapi {
@@ -125,6 +126,43 @@
&FileSystemOperation::DidFinishFileOperation));
}
+
+void FileSystemOperation::Write(
+ const FilePath&,
+ const GURL&,
+ int64) {
+#ifndef NDEBUG
+ DCHECK(!operation_pending_);
+ operation_pending_ = true;
+#endif
+ NOTREACHED();
+ // TODO(ericu):
+ // Set up a loop that, via multiple callback invocations, reads from a
+ // URLRequest wrapping blob_url, writes the bytes to the file, reports
+ // progress events no more frequently than some set rate, and periodically
+ // checks to see if it's been cancelled.
+}
+
+void FileSystemOperation::Truncate(const FilePath& path, int64 length) {
+#ifndef NDEBUG
+ DCHECK(!operation_pending_);
+ operation_pending_ = true;
+#endif
+ // TODO(ericu):
+ NOTREACHED();
+}
+
+void FileSystemOperation::Cancel() {
+#ifndef NDEBUG
+ DCHECK(operation_pending_);
+#endif
+ NOTREACHED();
+ // TODO(ericu):
+ // Make sure this was done on a FileSystemOperation used for a Write.
+ // Then set a flag that ensures that the Write loop will exit without
+ // reporting any more progress, with a failure notification.
+}
+
void FileSystemOperation::DidCreateFileExclusive(
base::PlatformFileError rv,
base::PassPlatformFile file,
@@ -194,4 +232,14 @@
dispatcher_->DidFail(rv);
}
+void FileSystemOperation::DidWrite(
+ base::PlatformFileError rv,
+ int64 bytes,
+ bool complete) {
+ if (rv == base::PLATFORM_FILE_OK)
+ /* dispatcher_->DidWrite(bytes, complete) TODO(ericu): Coming soon. */ {}
+ else
+ dispatcher_->DidFail(rv);
+}
+
} // namespace fileapi
« no previous file with comments | « webkit/fileapi/file_system_operation.h ('k') | webkit/tools/test_shell/simple_file_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698