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

Unified Diff: chrome/browser/sync/glue/bookmark_model_associator.cc

Issue 1105413002: Avoid conversion of index to BookmarkNode pointer unnacessarily. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 5 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
Index: chrome/browser/sync/glue/bookmark_model_associator.cc
diff --git a/chrome/browser/sync/glue/bookmark_model_associator.cc b/chrome/browser/sync/glue/bookmark_model_associator.cc
index d24a7e7db4d38332d740f51e1423773bae2969c2..0fa4409640cb1beba7ec62e8ee9dbb5b82f51973 100644
--- a/chrome/browser/sync/glue/bookmark_model_associator.cc
+++ b/chrome/browser/sync/glue/bookmark_model_associator.cc
@@ -705,7 +705,7 @@ int64 BookmarkModelAssociator::ApplyDeletesFromSyncJournal(
folders_matched.push_back(
FolderInfo(child, parent, delete_entry.id));
} else {
- bookmark_model_->Remove(parent, child_index);
+ bookmark_model_->Remove(child);
++num_bookmark_deleted;
}
// Move unmatched journal here and decrement counter.
@@ -725,7 +725,7 @@ int64 BookmarkModelAssociator::ApplyDeletesFromSyncJournal(
for (FolderInfoList::reverse_iterator it = folders_matched.rbegin();
it != folders_matched.rend(); ++it) {
if (it->folder->child_count() == 0) {
- bookmark_model_->Remove(it->parent, it->parent->GetIndexOf(it->folder));
+ bookmark_model_->Remove(it->folder);
++num_bookmark_deleted;
} else {
// Keep non-empty folder and remove its journal so that it won't match

Powered by Google App Engine
This is Rietveld 408576698