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

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

Issue 12907012: chromeos: Use RefreshEntry to implement DriveResourceMetadata::RenameEntry (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/drive/drive_resource_metadata.cc
diff --git a/chrome/browser/chromeos/drive/drive_resource_metadata.cc b/chrome/browser/chromeos/drive/drive_resource_metadata.cc
index 92cb2e24e13992468729160c15dd7bd54314725f..461ddcd6c7709069ba5d2858e409f7cc8dbcfe94 100644
--- a/chrome/browser/chromeos/drive/drive_resource_metadata.cc
+++ b/chrome/browser/chromeos/drive/drive_resource_metadata.cc
@@ -589,17 +589,9 @@ DriveResourceMetadata::RenameEntryOnBlockingPool(
return FileMoveResult(DRIVE_FILE_ERROR_EXISTS);
entry->set_title(new_name);
- storage_->PutEntry(*entry);
-
- // After changing the title of the entry, call MoveEntryToDirectory to
- // remove the entry from its parent directory and then add it back in order to
- // go through the file name de-duplication.
- // TODO(achuith/satorux/zel): This code is fragile. The title has been
- // changed, but not the file_name. MoveEntryToDirectory calls RemoveChild to
- // remove the child based on the old file_name, and then re-adds the child by
- // first assigning the new title to file_name. http://crbug.com/30157
- return MoveEntryToDirectoryOnBlockingPool(
- file_path, GetFilePath(entry->parent_resource_id()));
+ scoped_ptr<GetEntryInfoWithFilePathResult> result =
+ RefreshEntryOnBlockingPool(*entry);
+ return FileMoveResult(result->error, result->path);
}
DriveResourceMetadata::FileMoveResult
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698