Chromium Code Reviews| Index: chrome/browser/chromeos/gdata/gdata_files.cc |
| diff --git a/chrome/browser/chromeos/gdata/gdata_files.cc b/chrome/browser/chromeos/gdata/gdata_files.cc |
| index b402c7bcdcc1b82f557140d355b60bc471ba9056..28c899ff166b7db4fe7cc636e9ebfe1b8da70a8c 100644 |
| --- a/chrome/browser/chromeos/gdata/gdata_files.cc |
| +++ b/chrome/browser/chromeos/gdata/gdata_files.cc |
| @@ -543,6 +543,23 @@ void GDataRootDirectory::FindEntryByPath(const FilePath& file_path, |
| callback.Run(base::PLATFORM_FILE_ERROR_NOT_FOUND, NULL); |
| } |
| +void GDataRootDirectory::RefreshEntry( |
| + scoped_ptr<GDataEntry> fresh_entry) { |
| + DCHECK(fresh_entry.get()); |
| + |
| + GDataEntry* old_entry = GetEntryByResourceId(fresh_entry->resource_id()); |
| + GDataDirectory* entry_parent = old_entry ? old_entry->parent() : NULL; |
| + |
| + if (entry_parent) { |
| + DCHECK_EQ(fresh_entry->resource_id(), old_entry->resource_id()); |
| + DCHECK(fresh_entry->AsGDataFile()); |
| + DCHECK(old_entry->AsGDataFile()); |
|
satorux1
2012/05/31 15:56:01
here, we assume |fresh_entry| to be a file. The fu
tbarzic
2012/05/31 19:25:17
Done.
|
| + |
| + entry_parent->RemoveEntry(old_entry); |
| + entry_parent->AddEntry(fresh_entry.release()); |
| + } |
| +} |
| + |
| GDataEntry* GDataRootDirectory::GetEntryByResourceId( |
| const std::string& resource) { |
| // GDataFileSystem has already locked. |