summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-29 03:08:06 +0000
committerkinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-29 03:08:06 +0000
commit4572d42819f7618d51a57d817f1629b27f24084c (patch)
treee36281e1d4e80de069bf9660c6808a6538fb4d96
parent2a771313edc1c85ec433d83966bb1363412761e7 (diff)
downloadchromium_src-4572d42819f7618d51a57d817f1629b27f24084c.zip
chromium_src-4572d42819f7618d51a57d817f1629b27f24084c.tar.gz
chromium_src-4572d42819f7618d51a57d817f1629b27f24084c.tar.bz2
Wire FileSystemOperation::TouchFile to Drive.
Full implementation will be made possible once we start using the new Drive API (see the issue tracker for details). For the old WAPI, the operation calls back an 'invalid' error. BUG=144369 Review URL: https://chromiumcodereview.appspot.com/10875028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153835 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/gdata/drive_file_system_proxy.cc13
-rw-r--r--chrome/browser/chromeos/gdata/drive_file_system_proxy.h7
-rw-r--r--webkit/chromeos/fileapi/remote_file_system_operation.cc8
-rw-r--r--webkit/chromeos/fileapi/remote_file_system_proxy.h9
4 files changed, 34 insertions, 3 deletions
diff --git a/chrome/browser/chromeos/gdata/drive_file_system_proxy.cc b/chrome/browser/chromeos/gdata/drive_file_system_proxy.cc
index 5314d3c..a201a9a 100644
--- a/chrome/browser/chromeos/gdata/drive_file_system_proxy.cc
+++ b/chrome/browser/chromeos/gdata/drive_file_system_proxy.cc
@@ -554,6 +554,19 @@ void DriveFileSystemProxy::NotifyCloseFile(const FileSystemURL& url) {
base::Bind(&EmitDebugLogForCloseFile, file_path));
}
+void DriveFileSystemProxy::TouchFile(
+ const fileapi::FileSystemURL& url,
+ const base::Time& last_access_time,
+ const base::Time& last_modified_time,
+ const FileSystemOperation::StatusCallback& callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
+
+ // TODO(kinaba,kochi): crbug.com/144369. Support this operations once we have
+ // migrated to the new Drive API.
+ MessageLoopProxy::current()->PostTask(FROM_HERE,
+ base::Bind(callback, base::PLATFORM_FILE_ERROR_INVALID_OPERATION));
+}
+
void DriveFileSystemProxy::CreateSnapshotFile(
const FileSystemURL& file_url,
const FileSystemOperation::SnapshotFileCallback& callback) {
diff --git a/chrome/browser/chromeos/gdata/drive_file_system_proxy.h b/chrome/browser/chromeos/gdata/drive_file_system_proxy.h
index 0c63eb0..88eb045b 100644
--- a/chrome/browser/chromeos/gdata/drive_file_system_proxy.h
+++ b/chrome/browser/chromeos/gdata/drive_file_system_proxy.h
@@ -77,7 +77,12 @@ class DriveFileSystemProxy : public fileapi::RemoteFileSystemProxyInterface {
const fileapi::FileSystemOperation::OpenFileCallback&
callback) OVERRIDE;
virtual void NotifyCloseFile(const fileapi::FileSystemURL& url) OVERRIDE;
- // TODO(zelidrag): More methods to follow as we implement other parts of FSO.
+ virtual void TouchFile(
+ const fileapi::FileSystemURL& url,
+ const base::Time& last_access_time,
+ const base::Time& last_modified_time,
+ const fileapi::FileSystemOperation::StatusCallback& callback)
+ OVERRIDE;
protected:
virtual ~DriveFileSystemProxy();
diff --git a/webkit/chromeos/fileapi/remote_file_system_operation.cc b/webkit/chromeos/fileapi/remote_file_system_operation.cc
index 7f9190b..23f687a 100644
--- a/webkit/chromeos/fileapi/remote_file_system_operation.cc
+++ b/webkit/chromeos/fileapi/remote_file_system_operation.cc
@@ -177,7 +177,13 @@ void RemoteFileSystemOperation::TouchFile(const FileSystemURL& url,
const base::Time& last_access_time,
const base::Time& last_modified_time,
const StatusCallback& callback) {
- NOTIMPLEMENTED();
+ DCHECK(SetPendingOperationType(kOperationTouchFile));
+ remote_proxy_->TouchFile(
+ url,
+ last_access_time,
+ last_modified_time,
+ base::Bind(&RemoteFileSystemOperation::DidFinishFileOperation,
+ base::Owned(this), callback));
}
void RemoteFileSystemOperation::OpenFile(const FileSystemURL& url,
diff --git a/webkit/chromeos/fileapi/remote_file_system_proxy.h b/webkit/chromeos/fileapi/remote_file_system_proxy.h
index 5237e405..e54a266 100644
--- a/webkit/chromeos/fileapi/remote_file_system_proxy.h
+++ b/webkit/chromeos/fileapi/remote_file_system_proxy.h
@@ -103,7 +103,14 @@ class RemoteFileSystemProxyInterface :
// Notifies that a file opened by OpenFile (at |path|) is closed.
virtual void NotifyCloseFile(const FileSystemURL& url) = 0;
- // TODO(zelidrag): More methods to follow as we implement other parts of FSO.
+ // Modifies the timestamp of a given |url| to |last_access_time| and
+ // |last_modified_time|. Note that unlike 'touch' command of Linux, it
+ // does not create a new file.
+ virtual void TouchFile(
+ const fileapi::FileSystemURL& url,
+ const base::Time& last_access_time,
+ const base::Time& last_modified_time,
+ const FileSystemOperation::StatusCallback& callback) = 0;
protected:
friend class base::RefCountedThreadSafe<RemoteFileSystemProxyInterface>;