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

Unified Diff: sync/syncable/parent_child_index.cc

Issue 1139883007: Sync: ParentChildIndex fix for out of order deletion of entries by PurgeEntriesWithTypeIn. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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: sync/syncable/parent_child_index.cc
diff --git a/sync/syncable/parent_child_index.cc b/sync/syncable/parent_child_index.cc
index d9c0052cdf5e131c105fec813ab7c6a264ef7ec9..0cab1d3942eb47b0bc1d1ebb8215633deef4492b 100644
--- a/sync/syncable/parent_child_index.cc
+++ b/sync/syncable/parent_child_index.cc
@@ -85,15 +85,6 @@ bool ParentChildIndex::Insert(EntryKernel* entry) {
// given EntryKernel but does not delete it.
void ParentChildIndex::Remove(EntryKernel* e) {
const Id& parent_id = GetParentId(e);
- // Clear type root ID when removing a type root entry.
- if (parent_id.IsRoot()) {
- ModelType model_type = GetModelType(e);
- // TODO(stanisc): the check is needed to work around some tests.
- // See TODO above.
- if (model_type_root_ids_[model_type] == e->ref(ID)) {
- model_type_root_ids_[model_type] = Id();
- }
- }
ParentChildrenMap::iterator parent = parent_children_map_.find(parent_id);
DCHECK(parent != parent_children_map_.end());
@@ -126,7 +117,7 @@ const OrderedChildSet* ParentChildIndex::GetChildren(const Id& id) const {
ParentChildrenMap::const_iterator parent = parent_children_map_.find(id);
if (parent == parent_children_map_.end()) {
- return NULL;
+ return nullptr;
}
// A successful lookup implies at least some children exist.
« no previous file with comments | « chrome/browser/sync/glue/typed_url_change_processor.cc ('k') | sync/syncable/parent_child_index_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698