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

Issue 337037: Make some improvements to sync model associator:... (Closed)

Created:
11 years, 1 month ago by Munjal (Google)
Modified:
9 years ago
CC:
chromium-reviews_googlegroups.com, Paweł Hajdan Jr., ncarter (slow), ben+cc_chromium.org, tim (not reviewing), idana, sky
Visibility:
Public.

Description

Make some improvements to sync model associator: - Fail the load assocications if there the total number of nodes in the bookmark model and the sync model don't match (issue: 25542) - Add a bookmark id index and use that during load assocications instead of calling BookmarkModel::GetNodeByID since the latter traverses the entier tree in DFS order until it finds the node with the given ID. - Add a unit test that would exercise the new model associator load associations behavior. BUG=25542 TEST=Unit test added. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=30441

Patch Set 1 #

Total comments: 4

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 8

Patch Set 4 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+87 lines, -6 lines) Patch
M chrome/browser/sync/glue/model_associator.cc View 1 2 3 7 chunks +67 lines, -6 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_unittest.cc View 1 2 3 1 chunk +20 lines, -0 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Munjal (Google)
11 years, 1 month ago (2009-10-27 01:33:33 UTC) #1
tim (not reviewing)
http://codereview.chromium.org/337037/diff/1/2 File chrome/browser/sync/glue/model_associator.cc (right): http://codereview.chromium.org/337037/diff/1/2#newcode133 Line 133: typedef std::map<int64, const BookmarkNode*> BookmarkIdMap; I would use ...
11 years, 1 month ago (2009-10-27 21:46:54 UTC) #2
Munjal (Google)
http://codereview.chromium.org/337037/diff/1/2 File chrome/browser/sync/glue/model_associator.cc (right): http://codereview.chromium.org/337037/diff/1/2#newcode133 Line 133: typedef std::map<int64, const BookmarkNode*> BookmarkIdMap; On 2009/10/27 21:46:56, ...
11 years, 1 month ago (2009-10-28 19:50:54 UTC) #3
tim (not reviewing)
LGTM with nits addressed. +cc sky in case he has thoughts/concerns about the following I ...
11 years, 1 month ago (2009-10-28 22:12:29 UTC) #4
Munjal (Google)
http://codereview.chromium.org/337037/diff/5002/6002 File chrome/browser/sync/glue/model_associator.cc (right): http://codereview.chromium.org/337037/diff/5002/6002#newcode118 Line 118: public: On 2009/10/28 22:12:29, timsteele wrote: > nit- ...
11 years, 1 month ago (2009-10-28 22:27:37 UTC) #5
Munjal (Google)
11 years, 1 month ago (2009-10-28 22:31:47 UTC) #6
On Wed, Oct 28, 2009 at 3:12 PM, <tim@chromium.org> wrote:

> LGTM with nits addressed.
>
> +cc sky in case he has thoughts/concerns about the following
>
> I think what you've got here works just fine. The only other possible
> improvement I came up with is if it would be possible for the BookmarkCodec
> (or
> whatever entity parses the JSON file) to just track how many actual nodes
> it
> parsed when it loaded the file at startup.  This count wouldn't have to be
> kept
> up to date in the BookmarkModel. It would get set at the start, and never
> change
> after. But we could query it from here, and it would suffice for our
> purposes.
>
>
I probably didn't clarify well in person yesterday that this is not needed
and doesn't improve anything because we now already build an ID index and
hence querying the size of the hash map of that index gives us the number of
nodes.

If we didn't need the ID index, then such a change might help, but we do
need ID index.


> http://codereview.chromium.org/337037/diff/5002/6002
>
> File chrome/browser/sync/glue/model_associator.cc (right):
>
> http://codereview.chromium.org/337037/diff/5002/6002#newcode118
> Line 118: public:
> nit- indent
>
> http://codereview.chromium.org/337037/diff/5002/6002#newcode150
> Line 150: for (int i = 0; i < node->GetChildCount(); ++i) {
> nit- you don't use squiggles for the other one-line control/condition
> statements in here, please choose one of the two for consistency.
>
> http://codereview.chromium.org/337037/diff/5002/6002#newcode206
> Line 206: // bookmark node pointers in our ID maps to avoid finding node
> by IDs.
> can we file a bug to track and reference here?
>
> http://codereview.chromium.org/337037/diff/5002/6003
> File chrome/browser/sync/profile_sync_service_unittest.cc (right):
>
> http://codereview.chromium.org/337037/diff/5002/6003#newcode1253
> Line 1253: // Now restart the sync service. This time it should use the
> persistent
> Wait, use the persisted associations, or rebuild?
>
>
> http://codereview.chromium.org/337037
>

Powered by Google App Engine
This is Rietveld 408576698