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

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

Issue 118953003: drive: Stop setting dummy resource ID for "drive" and "other" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 1fd95dc98a82944dfa10e12e8f142b68839c2a8b..b3a5954e0f04b65d99889c2cb2039dd4954c2fa9 100644
--- a/chrome/browser/chromeos/drive/resource_metadata.cc
+++ b/chrome/browser/chromeos/drive/resource_metadata.cc
@@ -119,24 +119,30 @@ bool ResourceMetadata::SetUpDefaultEntries() {
if (!storage_->GetEntry(util::kDriveGrandRootLocalId, &entry)) {
ResourceEntry root;
root.mutable_file_info()->set_is_directory(true);
- // TODO(hashimoto): Stop setting dummy resource ID here.
- root.set_resource_id(util::kDriveGrandRootLocalId);
root.set_local_id(util::kDriveGrandRootLocalId);
root.set_title(util::kDriveGrandRootDirName);
SetBaseNameFromTitle(&root);
if (!storage_->PutEntry(root))
return false;
+ } else if (!entry.resource_id().empty()) {
+ // Old implementations used kDriveGrandRootLocalId as a resource ID.
+ entry.clear_resource_id();
+ if (!storage_->PutEntry(entry))
+ return false;
}
if (!storage_->GetEntry(util::kDriveOtherDirLocalId, &entry)) {
ResourceEntry other_dir;
other_dir.mutable_file_info()->set_is_directory(true);
- // TODO(hashimoto): Stop setting dummy resource ID here.
- other_dir.set_resource_id(util::kDriveOtherDirLocalId);
other_dir.set_local_id(util::kDriveOtherDirLocalId);
other_dir.set_parent_local_id(util::kDriveGrandRootLocalId);
other_dir.set_title(util::kDriveOtherDirName);
if (!PutEntryUnderDirectory(other_dir))
return false;
+ } else if (!entry.resource_id().empty()) {
+ // Old implementations used kDriveOtherDirLocalId as a resource ID.
+ entry.clear_resource_id();
+ if (!storage_->PutEntry(entry))
+ return false;
}
if (!storage_->GetEntry(util::kDriveTrashDirLocalId, &entry)) {
ResourceEntry trash_dir;

Powered by Google App Engine
This is Rietveld 408576698