summaryrefslogtreecommitdiffstats
path: root/webkit/chromeos
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/chromeos')
-rw-r--r--webkit/chromeos/fileapi/remote_file_system_operation.cc16
-rw-r--r--webkit/chromeos/fileapi/remote_file_system_operation.h7
-rw-r--r--webkit/chromeos/fileapi/remote_file_system_proxy.h7
3 files changed, 28 insertions, 2 deletions
diff --git a/webkit/chromeos/fileapi/remote_file_system_operation.cc b/webkit/chromeos/fileapi/remote_file_system_operation.cc
index b84818a..83fcd5e 100644
--- a/webkit/chromeos/fileapi/remote_file_system_operation.cc
+++ b/webkit/chromeos/fileapi/remote_file_system_operation.cc
@@ -140,8 +140,11 @@ RemoteFileSystemOperation::AsFileSystemOperation() {
void RemoteFileSystemOperation::CreateSnapshotFile(
const GURL& path,
const SnapshotFileCallback& callback) {
- LOG(WARNING) << "No implementation for " << path.spec();
- NOTIMPLEMENTED();
+ DCHECK(SetPendingOperationType(kOperationCreateSnapshotFile));
+ remote_proxy_->CreateSnapshotFile(
+ path,
+ base::Bind(&RemoteFileSystemOperation::DidCreateSnapshotFile,
+ base::Owned(this), callback));
}
bool RemoteFileSystemOperation::SetPendingOperationType(OperationType type) {
@@ -193,4 +196,13 @@ void RemoteFileSystemOperation::DidFinishFileOperation(
callback.Run(rv);
}
+void RemoteFileSystemOperation::DidCreateSnapshotFile(
+ const SnapshotFileCallback& callback,
+ base::PlatformFileError result,
+ const base::PlatformFileInfo& file_info,
+ const FilePath& platform_path,
+ const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref) {
+ callback.Run(result, file_info, platform_path, file_ref);
+}
+
} // namespace chromeos
diff --git a/webkit/chromeos/fileapi/remote_file_system_operation.h b/webkit/chromeos/fileapi/remote_file_system_operation.h
index 3cbd665..b167527 100644
--- a/webkit/chromeos/fileapi/remote_file_system_operation.h
+++ b/webkit/chromeos/fileapi/remote_file_system_operation.h
@@ -99,6 +99,13 @@ class RemoteFileSystemOperation : public fileapi::FileSystemOperationInterface {
bool has_more);
void DidFinishFileOperation(const StatusCallback& callback,
base::PlatformFileError rv);
+ void DidCreateSnapshotFile(
+ const SnapshotFileCallback& callback,
+ base::PlatformFileError result,
+ const base::PlatformFileInfo& file_info,
+ const FilePath& platform_path,
+ const scoped_refptr<webkit_blob::ShareableFileReference>& file_ref);
+
scoped_refptr<fileapi::RemoteFileSystemProxyInterface> remote_proxy_;
// A flag to make sure we call operation only once per instance.
diff --git a/webkit/chromeos/fileapi/remote_file_system_proxy.h b/webkit/chromeos/fileapi/remote_file_system_proxy.h
index d683282..c749982 100644
--- a/webkit/chromeos/fileapi/remote_file_system_proxy.h
+++ b/webkit/chromeos/fileapi/remote_file_system_proxy.h
@@ -58,6 +58,13 @@ class RemoteFileSystemProxyInterface :
bool recursive,
const FileSystemOperationInterface::StatusCallback& callback) = 0;
+ // Creates a local snapshot file for a given |path| and returns the
+ // metadata and platform path of the snapshot file via |callback|.
+ // See also FileSystemOperationInterface::CreateSnapshotFile().
+ virtual void CreateSnapshotFile(
+ const GURL& path,
+ const FileSystemOperationInterface::SnapshotFileCallback& callback) = 0;
+
// TODO(zelidrag): More methods to follow as we implement other parts of FSO.
};