summaryrefslogtreecommitdiffstats
path: root/webkit/fileapi
diff options
context:
space:
mode:
authornhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-11 10:35:53 +0000
committernhiroki@chromium.org <nhiroki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-11 10:35:53 +0000
commitd007e46dda2bdec6969c83d8c60dff8a7325bfbf (patch)
treebedb15a9dc2818095646fd71c273f9c0d27388da /webkit/fileapi
parent944d9a980092193e851f8cc157d0c1ea5c5c6e34 (diff)
downloadchromium_src-d007e46dda2bdec6969c83d8c60dff8a7325bfbf.zip
chromium_src-d007e46dda2bdec6969c83d8c60dff8a7325bfbf.tar.gz
chromium_src-d007e46dda2bdec6969c83d8c60dff8a7325bfbf.tar.bz2
Add Copy and Move operations to CannedSyncableFileSystem
We are adding tests which cover these operations in a separate CL (http://codereview.chromium.org/11090040/) TEST=n/a Review URL: https://chromiumcodereview.appspot.com/11099060 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@161325 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi')
-rw-r--r--webkit/fileapi/syncable/canned_syncable_file_system.cc22
-rw-r--r--webkit/fileapi/syncable/canned_syncable_file_system.h4
2 files changed, 26 insertions, 0 deletions
diff --git a/webkit/fileapi/syncable/canned_syncable_file_system.cc b/webkit/fileapi/syncable/canned_syncable_file_system.cc
index 50e4c51..84cdc92 100644
--- a/webkit/fileapi/syncable/canned_syncable_file_system.cc
+++ b/webkit/fileapi/syncable/canned_syncable_file_system.cc
@@ -99,6 +99,28 @@ PlatformFileError CannedSyncableFileSystem::CreateFile(
return result_;
}
+PlatformFileError CannedSyncableFileSystem::Copy(
+ const FileSystemURL& src_url, const FileSystemURL& dest_url) {
+ result_ = base::PLATFORM_FILE_ERROR_FAILED;
+ test_helper_.NewOperation()->Copy(
+ src_url, dest_url,
+ base::Bind(&CannedSyncableFileSystem::StatusCallback,
+ weak_factory_.GetWeakPtr()));
+ MessageLoop::current()->RunAllPending();
+ return result_;
+}
+
+PlatformFileError CannedSyncableFileSystem::Move(
+ const FileSystemURL& src_url, const FileSystemURL& dest_url) {
+ result_ = base::PLATFORM_FILE_ERROR_FAILED;
+ test_helper_.NewOperation()->Move(
+ src_url, dest_url,
+ base::Bind(&CannedSyncableFileSystem::StatusCallback,
+ weak_factory_.GetWeakPtr()));
+ MessageLoop::current()->RunAllPending();
+ return result_;
+}
+
PlatformFileError CannedSyncableFileSystem::TruncateFile(
const FileSystemURL& url, int64 size) {
result_ = base::PLATFORM_FILE_ERROR_FAILED;
diff --git a/webkit/fileapi/syncable/canned_syncable_file_system.h b/webkit/fileapi/syncable/canned_syncable_file_system.h
index e8935f7..d0b2b2358 100644
--- a/webkit/fileapi/syncable/canned_syncable_file_system.h
+++ b/webkit/fileapi/syncable/canned_syncable_file_system.h
@@ -63,6 +63,10 @@ class CannedSyncableFileSystem {
// (They run on the current thread and returns synchronously).
base::PlatformFileError CreateDirectory(const FileSystemURL& url);
base::PlatformFileError CreateFile(const FileSystemURL& url);
+ base::PlatformFileError Copy(const FileSystemURL& src_url,
+ const FileSystemURL& dest_url);
+ base::PlatformFileError Move(const FileSystemURL& src_url,
+ const FileSystemURL& dest_url);
base::PlatformFileError TruncateFile(const FileSystemURL& url, int64 size);
base::PlatformFileError Remove(const FileSystemURL& url, bool recursive);