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

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

Issue 296463002: drive: Stop using FileCacheEntry related methods in FileCache (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Do not overwrite cache state with RefreshEntry 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
Index: chrome/browser/chromeos/drive/resource_metadata.cc
diff --git a/chrome/browser/chromeos/drive/resource_metadata.cc b/chrome/browser/chromeos/drive/resource_metadata.cc
index 979cdb889033db31a58426015d820e2c4379d0e2..90ab4c96046dfc1a33f82f517cdd71d3d372c45a 100644
--- a/chrome/browser/chromeos/drive/resource_metadata.cc
+++ b/chrome/browser/chromeos/drive/resource_metadata.cc
@@ -387,8 +387,17 @@ FileError ResourceMetadata::RefreshEntry(const ResourceEntry& entry) {
if (!new_parent.file_info().is_directory())
return FILE_ERROR_NOT_A_DIRECTORY;
+ // Do not overwrite cache states.
+ // Cache state should be changed via FileCache.
+ ResourceEntry updated_entry(entry);
+ if (old_entry.file_specific_info().has_cache_state()) {
+ *updated_entry.mutable_file_specific_info()->mutable_cache_state() =
+ old_entry.file_specific_info().cache_state();
+ } else if (updated_entry.file_specific_info().has_cache_state()) {
+ updated_entry.mutable_file_specific_info()->clear_cache_state();
+ }
// Remove from the old parent and add it to the new parent with the new data.
- return PutEntryUnderDirectory(entry);
+ return PutEntryUnderDirectory(updated_entry);
}
FileError ResourceMetadata::GetSubDirectoriesRecursively(
« no previous file with comments | « chrome/browser/chromeos/drive/file_cache_unittest.cc ('k') | chrome/browser/chromeos/drive/resource_metadata_storage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698