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

Unified Diff: chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc

Issue 9662041: Implement copy and move operations within the same remote file system. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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
Index: chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc
===================================================================
--- chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc (revision 126063)
+++ chrome/browser/chromeos/gdata/gdata_file_system_proxy.cc (working copy)
@@ -4,6 +4,8 @@
#include "chrome/browser/chromeos/gdata/gdata_file_system_proxy.h"
+#include <vector>
+
#include "base/bind.h"
#include "base/platform_file.h"
#include "base/string_util.h"
@@ -71,7 +73,6 @@
}
private:
-
// Relays reply back to the callback on calling thread.
void Reply(base::PlatformFileError result,
const base::PlatformFileInfo& file_info,
@@ -151,7 +152,6 @@
}
private:
-
// Relays reply back to the callback on calling thread.
void Reply(base::PlatformFileError result,
const std::vector<base::FileUtilProxy::Entry>& file_list,
@@ -207,7 +207,34 @@
file_path, new GetFileInfoDelegate(file_system_, file_path, callback));
}
+void GDataFileSystemProxy::Copy(const GURL& src_file_url,
+ const GURL& dest_file_url,
+ const FileSystemOperationInterface::StatusCallback& callback) {
+ FilePath src_file_path, dest_file_path;
+ if (!ValidateUrl(src_file_url, &src_file_path) ||
+ !ValidateUrl(dest_file_url, &dest_file_path)) {
+ MessageLoopProxy::current()->PostTask(FROM_HERE,
+ base::Bind(callback, base::PLATFORM_FILE_ERROR_NOT_FOUND));
+ return;
+ }
+ file_system_->Copy(src_file_path, dest_file_path, callback);
+}
+
+void GDataFileSystemProxy::Move(const GURL& src_file_url,
+ const GURL& dest_file_url,
+ const FileSystemOperationInterface::StatusCallback& callback) {
+ FilePath src_file_path, dest_file_path;
+ if (!ValidateUrl(src_file_url, &src_file_path) ||
+ !ValidateUrl(dest_file_url, &dest_file_path)) {
+ MessageLoopProxy::current()->PostTask(FROM_HERE,
+ base::Bind(callback, base::PLATFORM_FILE_ERROR_NOT_FOUND));
+ return;
+ }
+
+ file_system_->Move(src_file_path, dest_file_path, callback);
+}
+
void GDataFileSystemProxy::ReadDirectory(const GURL& file_url,
const FileSystemOperationInterface::ReadDirectoryCallback& callback) {
FilePath file_path;

Powered by Google App Engine
This is Rietveld 408576698