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

Unified Diff: chrome/browser/chromeos/drive/file_system/create_file_operation.cc

Issue 23565004: drive: Stop using resource ID to access local metadata from CreateFileOperation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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/file_system/create_file_operation.cc
diff --git a/chrome/browser/chromeos/drive/file_system/create_file_operation.cc b/chrome/browser/chromeos/drive/file_system/create_file_operation.cc
index 8e591cd895b5de47fbe81e7e0b6532457fc36e05..67cc830a546cfd7891e85598758c5152ad60b10c 100644
--- a/chrome/browser/chromeos/drive/file_system/create_file_operation.cc
+++ b/chrome/browser/chromeos/drive/file_system/create_file_operation.cc
@@ -90,11 +90,15 @@ FileError UpdateLocalStateForCreateFile(
if (!ConvertToResourceEntry(*resource_entry, &entry, &parent_resource_id))
return FILE_ERROR_NOT_A_FILE;
- // TODO(hashimoto): Resolve local ID before use. crbug.com/260514
- entry.set_parent_local_id(parent_resource_id);
+ std::string parent_local_id;
+ FileError error = metadata->GetIdByResourceId(parent_resource_id,
+ &parent_local_id);
+ if (error != FILE_ERROR_OK)
+ return error;
+ entry.set_parent_local_id(parent_local_id);
std::string local_id;
- FileError error = metadata->AddEntry(entry, &local_id);
+ error = metadata->AddEntry(entry, &local_id);
// Depending on timing, the metadata may have inserted via change list
// already. So, FILE_ERROR_EXISTS is not an error.
« 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