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

Unified Diff: webkit/fileapi/file_system_operation.cc

Issue 3417018: Adding a TouchFile() operation. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 3 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
« no previous file with comments | « webkit/fileapi/file_system_operation.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/file_system_operation.cc
===================================================================
--- webkit/fileapi/file_system_operation.cc (revision 60236)
+++ webkit/fileapi/file_system_operation.cc (working copy)
@@ -4,6 +4,7 @@
#include "webkit/fileapi/file_system_operation.h"
+#include "base/time.h"
#include "webkit/fileapi/file_system_callback_dispatcher.h"
namespace fileapi {
@@ -125,6 +126,19 @@
&FileSystemOperation::DidFinishFileOperation));
}
+void FileSystemOperation::TouchFile(const FilePath& path,
+ const base::Time& last_access_time,
+ const base::Time& last_modified_time) {
+#ifndef NDEBUG
+ DCHECK(!operation_pending_);
+ operation_pending_ = true;
+#endif
+
+ base::FileUtilProxy::Touch(
+ proxy_, path, last_access_time, last_modified_time,
+ callback_factory_.NewCallback(&FileSystemOperation::DidTouchFile));
+}
+
void FileSystemOperation::DidCreateFileExclusive(
base::PlatformFileError rv,
base::PassPlatformFile file,
@@ -194,4 +208,11 @@
dispatcher_->DidFail(rv);
}
+void FileSystemOperation::DidTouchFile(base::PlatformFileError rv) {
+ if (rv == base::PLATFORM_FILE_OK)
+ dispatcher_->DidSucceed();
+ else
+ dispatcher_->DidFail(rv);
+}
+
} // namespace fileapi
« no previous file with comments | « webkit/fileapi/file_system_operation.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698