diff options
author | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-27 21:22:01 +0000 |
---|---|---|
committer | dumi@chromium.org <dumi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-27 21:22:01 +0000 |
commit | ed7ae173fbca0de5cb95c990fed727ea15172cd4 (patch) | |
tree | e94ae0632eec0d649dad8fa1953cf0932c35cbda /webkit/fileapi/file_system_operation.cc | |
parent | 6783d72a34e5d25655d5c9d054f2700f3d2488ff (diff) | |
download | chromium_src-ed7ae173fbca0de5cb95c990fed727ea15172cd4.zip chromium_src-ed7ae173fbca0de5cb95c990fed727ea15172cd4.tar.gz chromium_src-ed7ae173fbca0de5cb95c990fed727ea15172cd4.tar.bz2 |
Adding a TouchFile() operation.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3417018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60710 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/fileapi/file_system_operation.cc')
-rw-r--r-- | webkit/fileapi/file_system_operation.cc | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/webkit/fileapi/file_system_operation.cc b/webkit/fileapi/file_system_operation.cc index ffe5e5f..140ade4 100644 --- a/webkit/fileapi/file_system_operation.cc +++ b/webkit/fileapi/file_system_operation.cc @@ -4,6 +4,7 @@ #include "webkit/fileapi/file_system_operation.h" +#include "base/time.h" #include "googleurl/src/gurl.h" #include "webkit/fileapi/file_system_callback_dispatcher.h" @@ -126,7 +127,6 @@ void FileSystemOperation::Remove(const FilePath& path) { &FileSystemOperation::DidFinishFileOperation)); } - void FileSystemOperation::Write( const FilePath&, const GURL&, @@ -152,6 +152,19 @@ void FileSystemOperation::Truncate(const FilePath& path, int64 length) { NOTREACHED(); } +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::Cancel() { #ifndef NDEBUG DCHECK(operation_pending_); @@ -242,4 +255,11 @@ void FileSystemOperation::DidWrite( dispatcher_->DidFail(rv); } +void FileSystemOperation::DidTouchFile(base::PlatformFileError rv) { + if (rv == base::PLATFORM_FILE_OK) + dispatcher_->DidSucceed(); + else + dispatcher_->DidFail(rv); +} + } // namespace fileapi |