summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi/file_system_operation.cc
diff options
context:
space:
mode:
authorericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-24 01:06:00 +0000
committerericu@google.com <ericu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-24 01:06:00 +0000
commitac716267efc98d9fcdf9c3c22b10e6a9d8a9dbc8 (patch)
tree83a2b5f323ab94ae9ce25eea6f3b50c87f3b1353 /webkit/fileapi/file_system_operation.cc
parent09618270d0997bd325786d19182202ccb80fa945 (diff)
downloadchromium_src-ac716267efc98d9fcdf9c3c22b10e6a9d8a9dbc8.zip
chromium_src-ac716267efc98d9fcdf9c3c22b10e6a9d8a9dbc8.tar.gz
chromium_src-ac716267efc98d9fcdf9c3c22b10e6a9d8a9dbc8.tar.bz2
This is the IPC and bits of the browser backend for FileWriter. The rest of
it's too tied together to include a small amount; this is the most-significant chunk that I could put up without making too big a changelist. The backend isn't complete, but you can see where it's going from here. BUG=none TEST=none Review URL: http://codereview.chromium.org/3440021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60396 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/file_system_operation.cc')
-rw-r--r--webkit/fileapi/file_system_operation.cc48
1 files changed, 48 insertions, 0 deletions
diff --git a/webkit/fileapi/file_system_operation.cc b/webkit/fileapi/file_system_operation.cc
index dba9881..ffe5e5f 100644
--- a/webkit/fileapi/file_system_operation.cc
+++ b/webkit/fileapi/file_system_operation.cc
@@ -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 @@ void FileSystemOperation::Remove(const FilePath& path) {
&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 @@ void FileSystemOperation::DidReadDirectory(
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