diff options
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 |