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

Unified Diff: chrome/browser/chromeos/drive/file_cache.cc

Issue 304183005: drive: Always use last_modified stored in ResourceEntry (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « no previous file | chrome/browser/chromeos/drive/file_cache_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/file_cache.cc
diff --git a/chrome/browser/chromeos/drive/file_cache.cc b/chrome/browser/chromeos/drive/file_cache.cc
index 86dcedbe6b13a2bfd9127cee2c0083f126bd42db..b8dec708531180a09c10f70521d854e171c0411b 100644
--- a/chrome/browser/chromeos/drive/file_cache.cc
+++ b/chrome/browser/chromeos/drive/file_cache.cc
@@ -591,6 +591,22 @@ void FileCache::CloseForWrite(const std::string& id) {
--it->second;
if (it->second == 0)
write_opened_files_.erase(it);
+
+ // Update last modified date.
+ ResourceEntry entry;
+ FileError error = storage_->GetEntry(id, &entry);
+ if (error != FILE_ERROR_OK) {
+ LOG(ERROR) << "Failed to get entry: " << id << ", "
+ << FileErrorToString(error);
+ return;
+ }
+ entry.mutable_file_info()->set_last_modified(
+ base::Time::Now().ToInternalValue());
+ error = storage_->PutEntry(entry);
+ if (error != FILE_ERROR_OK) {
+ LOG(ERROR) << "Failed to put entry: " << id << ", "
+ << FileErrorToString(error);
+ }
}
} // namespace internal
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/file_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698