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

Issue 2752523003: [sync] use std::multimap for BookmarkNodeMap (Closed)

Created:
3 years, 9 months ago by pavely
Modified:
3 years, 9 months ago
Reviewers:
skym
CC:
chromium-reviews
Target Ref:
refs/pending/branch-heads/3029
Project:
chromium
Visibility:
Public.

Description

[sync] use std::multimap for BookmarkNodeMap When associating bookmarks, sync nodes are matched to BookmarkNodes. To match a BookmarkNode with a sync node, a BookmarkNodeFinder is created and asked to find the child node with the matching title. When searching for the title, BookmarkNodeFinder returns the first matching child in its child_nodes_ map. This map is an unordered_map with undefined iteration order. If sync node siblings share a title, the BookmarkNodeFinder can erroneously swap their respective BookmarkNodes. To fix this, this CL makes the iteration order defined with std::multimap, which stores pairs in insertion order. This is safe since sync nodes are processed in the same order as BookmarkNodes are stored. R=skym@chromium.org BUG= Review-Url: https://codereview.chromium.org/2743713005 Cr-Commit-Position: refs/heads/master@{#456234} (cherry picked from commit e4a5c1d83e0288ebe94f1d7bae7a76d8c01efffe) Review-Url: https://codereview.chromium.org/2752523003 . Cr-Commit-Position: refs/branch-heads/3029@{#192} Cr-Branched-From: 939b32ee5ba05c396eef3fd992822fcca9a2e262-refs/heads/master@{#454471} Committed: https://chromium.googlesource.com/chromium/src/+/b3eca2062fda3945fcf759a70f9eb6c10c775d82

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M components/sync_bookmarks/bookmark_model_associator.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 2 (1 generated)
pavely
3 years, 9 months ago (2017-03-14 19:03:10 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
b3eca2062fda3945fcf759a70f9eb6c10c775d82.

Powered by Google App Engine
This is Rietveld 408576698