diff options
author | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-22 19:28:00 +0000 |
---|---|---|
committer | tim@chromium.org <tim@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-22 19:28:00 +0000 |
commit | 999f38021e4e9c6a98e28b2198e1fd190064265e (patch) | |
tree | 3e7c7006266dc7ad6c97b63f92c313aba65f7d93 /breakpad | |
parent | 11309735fce8bf91f70643e955c6153b79f40095 (diff) | |
download | chromium_src-999f38021e4e9c6a98e28b2198e1fd190064265e.zip chromium_src-999f38021e4e9c6a98e28b2198e1fd190064265e.tar.gz chromium_src-999f38021e4e9c6a98e28b2198e1fd190064265e.tar.bz2 |
Don't allow duplicate bookmark node ids by always assigning ids with the ones generated by the codec.
The bookmark bar and other bookmarks nodes get initialized
by the model to ids 1 and 2, respectively. Later, when the
BookmarkCodec is decoding, it starts with the bookmark bar which
has id 1, but continues depth-first from this node instead of
handling other_bookmarks next. This means the first child of
the bookmark bar gets id 2, and this was colliding with
other_bookmarks because the codec wasn't overwriting the id
when a valid |node| is passed in. In other words, two exclusive
unique ID generators are not better than one.
I considered other things, like calling RecordId on the id_generator
for the "special node" ids, but that caused PersistIds test to fail.
Also considered special-casing the two special nodes in Decode, but
those attempts felt either more subtle or lame than this one.
TEST=BookmarkModelTestWithProfile.CreateAndRestore
Review URL: http://codereview.chromium.org/115696
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16772 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'breakpad')
0 files changed, 0 insertions, 0 deletions