diff options
author | rch <rch@chromium.org> | 2015-02-09 16:07:17 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-10 00:07:56 +0000 |
commit | f44a826b177af9fc9fc3c81590b0cc15267cbf76 (patch) | |
tree | e8f59a4af0c2eb0dc29394ea03e306f23b1d74d5 /sync | |
parent | 3a75e7a319c93e3375d3a1f18040f86f9eed9296 (diff) | |
download | chromium_src-f44a826b177af9fc9fc3c81590b0cc15267cbf76.zip chromium_src-f44a826b177af9fc9fc3c81590b0cc15267cbf76.tar.gz chromium_src-f44a826b177af9fc9fc3c81590b0cc15267cbf76.tar.bz2 |
Revert of Use external ID to match native model nodes during bookmark association. (patchset #2 id:40001 of https://codereview.chromium.org/904083002/)
Reason for revert:
Looks like it broke a sync_unittest
http://build.chromium.org/p/chromium.win/builders/Win7%20Tests%20%28dbg%29%281%29/builds/35199
(But maybe it's a flake?)
Original issue's description:
> Use external ID to match native model nodes during bookmark association.
>
> The fix improves matching of nodes in BookmarkModelAssociator in
> situations where there are multiple bookmarks or folders with the
> same titles or URLs.
> This will address one particular scenario leading to bookmark
> duplication (see crbug.com/118105).
>
> 1) In BookmarkModelAssociator::BuildAssociations, when there are
> multiple native model nodes with matching title / URL, a secondary
> match on external ID is used to pick a preferred one; otherwise
> the first matching node is returned.
> The preferred match on external ID should be applicable in most
> situations except when the native model has been rebuilt from scratch.
> Picking a wrong folder during the association process results in
> duplicating the entire subtree within the wrong folder. This issue
> should be addressed now.
> 2) In BookmarkModelAssociator::ApplyDeletesFromSyncJournal the external
> ID match is now the primary criteria for selecting a native model
> node to be deleted. The previous implementation would pick an arbitrary
> native model node based on just the title / URL match anywhere in the
> node hierarchy. That would happen every time after deleting a bookmark
> or folder and recreating it in another place.
> Since external IDs might be reused, there is a secondary match on
> title and URL to ensure that the right node gets deleted. To avoid
> costly O(N*M) algorithm (where N is number of bookmarks and M is
> number of entries in delete journal), the implementation uses a set
> of external IDs to reduce the cost to O(N*logM).
>
> BUG=456228
>
> Committed: https://crrev.com/89fce43a19e7f8b0225a0d750ec3eb3cb0939e3d
> Cr-Commit-Position: refs/heads/master@{#315401}
TBR=zea@chromium.org,stanisc@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=456228
Review URL: https://codereview.chromium.org/906403003
Cr-Commit-Position: refs/heads/master@{#315444}
Diffstat (limited to 'sync')
-rw-r--r-- | sync/internal_api/delete_journal.cc | 2 | ||||
-rw-r--r-- | sync/internal_api/public/delete_journal.h | 1 |
2 files changed, 0 insertions, 3 deletions
diff --git a/sync/internal_api/delete_journal.cc b/sync/internal_api/delete_journal.cc index edd10ae..ebeb5a7 100644 --- a/sync/internal_api/delete_journal.cc +++ b/sync/internal_api/delete_journal.cc @@ -21,8 +21,6 @@ void DeleteJournal::GetBookmarkDeleteJournals( deleted_entries.begin(); i != deleted_entries.end(); ++i) { delete_journal_list->push_back(BookmarkDeleteJournal()); delete_journal_list->back().id = (*i)->ref(syncer::syncable::META_HANDLE); - delete_journal_list->back().external_id = - (*i)->ref(syncer::syncable::LOCAL_EXTERNAL_ID); delete_journal_list->back().is_folder = (*i)->ref(syncer::syncable::IS_DIR); const sync_pb::EntitySpecifics& specifics = (*i)->ref( diff --git a/sync/internal_api/public/delete_journal.h b/sync/internal_api/public/delete_journal.h index ecf84fe..3152b02 100644 --- a/sync/internal_api/public/delete_journal.h +++ b/sync/internal_api/public/delete_journal.h @@ -17,7 +17,6 @@ class BaseTransaction; struct BookmarkDeleteJournal { int64 id; // Metahandle of delete journal entry. - int64 external_id; // Bookmark ID in the native model. bool is_folder; sync_pb::EntitySpecifics specifics; }; |