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

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

Issue 13876003: chromeos: Stop removing the entry from the storage of DriveResourceMetadata when unnecessary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 7930c7f148109bcfe9ac6da2c5a1a13c460b6184..cf017090260c174839dbc89de55d76faee56b7db 100644
--- a/chrome/browser/chromeos/drive/drive_resource_metadata.cc
+++ b/chrome/browser/chromeos/drive/drive_resource_metadata.cc
@@ -1033,6 +1033,7 @@ void DriveResourceMetadata::RemoveDirectoryChild(
scoped_ptr<DriveEntryProto> entry = storage_->GetEntry(child_resource_id);
DCHECK(entry);
DetachEntryFromDirectory(child_resource_id);
+ storage_->RemoveEntry(entry->resource_id());
if (entry->file_info().is_directory())
RemoveDirectoryChildren(child_resource_id);
}
@@ -1048,10 +1049,7 @@ void DriveResourceMetadata::DetachEntryFromDirectory(
DCHECK_EQ(entry->resource_id(),
storage_->GetChild(entry->parent_resource_id(),
entry->base_name()));
- // Remove entry from resource map first.
- storage_->RemoveEntry(entry->resource_id());
- // Then delete it from tree.
storage_->RemoveChild(entry->parent_resource_id(), entry->base_name());
}
« 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