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

Issue 93433006: sync: Introduce ModelTypeRegistry and helpers (Closed)

Created:
7 years ago by rlarocque
Modified:
6 years, 11 months ago
CC:
chromium-reviews, tim+watch_chromium.org, rsimha+watch_chromium.org, haitaol+watch_chromium.org, maniscalco+watch_chromium.org
Visibility:
Public.

Description

sync: Introduce ModelTypeRegistry and helpers Introduce the ModelTypeRegistry class and use it to manage the creation of UpdateHandlers and CommitContributors. The ModelTypeRegistry also gets some help from the newly introduced UpdaterList and CommitterList classes. This lets us move the verbose iteration logic out of the code that's focused on building and executing commits and updates, which should make those functions easier to read. It gives us more freedom to experiment with other ways to manage the lists of commit contributors and update handlers, should we choose to do so. It prevents us from leaking the set of enabled types through the per-type maps. This patch is one of the last in the stack related to building a per-type abstraction into the sync engine, and also one of the first steps towards implementing run-time enable and disable logic for the new-style sync types. BUG=278484 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=245654

Patch Set 1 #

Total comments: 2

Patch Set 2 : Split the type manager #

Total comments: 16

Patch Set 3 : Rebase, some fixes, and add ModelTypeRegistry #

Patch Set 4 : Rebase, some fixes, and add ModelTypeRegistry (2nd try) #

Patch Set 5 : Add missing files #

Total comments: 23

Patch Set 6 : Review fixes + delete sync_sessions_unittest.cc #

Total comments: 10

Patch Set 7 : More review fixes #

Total comments: 16

Patch Set 8 : Some fixes from Tim's review #

Patch Set 9 : Refactor map ownership #

Total comments: 2

Patch Set 10 : Refactory UpdaterList and CommitterList ownership #

Patch Set 11 : Renames and moves #

Total comments: 8

Patch Set 12 : Rebase + address comments #

Total comments: 10

Patch Set 13 : Fix nits #

Patch Set 14 : Fix memory leak in tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+789 lines, -528 lines) Patch
M sync/engine/commit.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +3 lines, -2 lines 0 comments Download
M sync/engine/commit.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +10 lines, -29 lines 0 comments Download
A sync/engine/commit_processor.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +54 lines, -0 lines 0 comments Download
A sync/engine/commit_processor.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +52 lines, -0 lines 0 comments Download
M sync/engine/download.h View 1 2 3 4 5 6 7 8 9 10 11 10 chunks +11 lines, -6 lines 0 comments Download
M sync/engine/download.cc View 1 2 3 4 5 6 7 8 9 10 11 12 chunks +25 lines, -119 lines 0 comments Download
M sync/engine/download_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 12 chunks +20 lines, -21 lines 0 comments Download
A sync/engine/get_updates_processor.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +72 lines, -0 lines 0 comments Download
A sync/engine/get_updates_processor.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +148 lines, -0 lines 0 comments Download
M sync/engine/process_updates_util.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +0 lines, -34 lines 0 comments Download
M sync/engine/process_updates_util.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +30 lines, -56 lines 0 comments Download
M sync/engine/sync_directory_commit_contributor.h View 1 chunk +0 lines, -4 lines 0 comments Download
M sync/engine/sync_directory_update_handler.h View 1 chunk +0 lines, -3 lines 0 comments Download
M sync/engine/sync_directory_update_handler_unittest.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M sync/engine/sync_scheduler_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M sync/engine/sync_scheduler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +8 lines, -3 lines 0 comments Download
M sync/engine/syncer.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +7 lines, -2 lines 0 comments Download
M sync/engine/syncer.cc View 1 2 3 4 5 6 7 8 9 10 11 9 chunks +36 lines, -12 lines 0 comments Download
M sync/engine/syncer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +8 lines, -4 lines 0 comments Download
M sync/internal_api/internal_components_factory_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -2 lines 0 comments Download
M sync/internal_api/public/internal_components_factory.h View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -2 lines 0 comments Download
M sync/internal_api/public/internal_components_factory_impl.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M sync/internal_api/public/test/test_internal_components_factory.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M sync/internal_api/sync_manager_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +5 lines, -0 lines 0 comments Download
M sync/internal_api/sync_manager_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +6 lines, -4 lines 0 comments Download
M sync/internal_api/sync_manager_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -1 line 0 comments Download
M sync/internal_api/test/test_internal_components_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +3 lines, -2 lines 0 comments Download
A sync/sessions/model_type_registry.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +68 lines, -0 lines 0 comments Download
A sync/sessions/model_type_registry.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +66 lines, -0 lines 0 comments Download
A sync/sessions/model_type_registry_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +114 lines, -0 lines 0 comments Download
M sync/sessions/sync_session_context.h View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +10 lines, -37 lines 0 comments Download
M sync/sessions/sync_session_context.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +4 lines, -31 lines 0 comments Download
D sync/sessions/sync_session_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -140 lines 0 comments Download
M sync/sync_core.gypi View 1 2 3 4 5 6 7 8 9 10 4 chunks +14 lines, -8 lines 0 comments Download
M sync/sync_tests.gypi View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 28 (0 generated)
rlarocque
I admit this was not part of my original plan, but I think the introduction ...
7 years ago (2013-12-11 00:46:39 UTC) #1
tim (not reviewing)
https://codereview.chromium.org/93433006/diff/1/sync/engine/sync_engine_type_manager.h File sync/engine/sync_engine_type_manager.h (right): https://codereview.chromium.org/93433006/diff/1/sync/engine/sync_engine_type_manager.h#newcode45 sync/engine/sync_engine_type_manager.h:45: class SYNC_EXPORT_PRIVATE SyncEngineTypeManager { non-publically exported class in the ...
7 years ago (2013-12-11 18:10:08 UTC) #2
rlarocque
I met with Tim offline to discuss his concerns. I think patch set 2, which ...
7 years ago (2013-12-17 19:54:30 UTC) #3
Nicolas Zea
https://codereview.chromium.org/93433006/diff/20001/sync/engine/committer_list.cc File sync/engine/committer_list.cc (right): https://codereview.chromium.org/93433006/diff/20001/sync/engine/committer_list.cc#newcode72 sync/engine/committer_list.cc:72: } for safety sake, perhaps also DCHECK_LT(num_entries, max_entries) https://codereview.chromium.org/93433006/diff/20001/sync/engine/committer_list.h ...
7 years ago (2013-12-18 22:36:09 UTC) #4
rlarocque
Patch rebased and refactored. PTAL. The first attempt at this patch had both the CommitContributors ...
6 years, 11 months ago (2014-01-03 01:46:40 UTC) #5
Nicolas Zea
I think this is moving in the right direction. So I'm clear, the hierarchy + ...
6 years, 11 months ago (2014-01-04 02:09:34 UTC) #6
rlarocque
Uploaded a new patch. PTAL. https://codereview.chromium.org/93433006/diff/90001/sync/engine/committer_list.h File sync/engine/committer_list.h (right): https://codereview.chromium.org/93433006/diff/90001/sync/engine/committer_list.h#newcode57 sync/engine/committer_list.h:57: STLValueDeleter<CommitContributorMap> commit_contributor_deleter_; On 2014/01/04 ...
6 years, 11 months ago (2014-01-06 20:03:32 UTC) #7
rlarocque
On 2014/01/04 02:09:34, Nicolas Zea wrote: > I think this is moving in the right ...
6 years, 11 months ago (2014-01-06 20:30:07 UTC) #8
Nicolas Zea
https://codereview.chromium.org/93433006/diff/90001/sync/engine/model_type_registry.h File sync/engine/model_type_registry.h (right): https://codereview.chromium.org/93433006/diff/90001/sync/engine/model_type_registry.h#newcode28 sync/engine/model_type_registry.h:28: const std::vector<ModelSafeWorker*>& workers); On 2014/01/06 20:03:33, rlarocque wrote: > ...
6 years, 11 months ago (2014-01-07 23:11:40 UTC) #9
rlarocque
Patch updated. PTAL. https://codereview.chromium.org/93433006/diff/90001/sync/engine/model_type_registry.h File sync/engine/model_type_registry.h (right): https://codereview.chromium.org/93433006/diff/90001/sync/engine/model_type_registry.h#newcode28 sync/engine/model_type_registry.h:28: const std::vector<ModelSafeWorker*>& workers); On 2014/01/07 23:11:40, ...
6 years, 11 months ago (2014-01-08 01:37:22 UTC) #10
tim (not reviewing)
I like where this is going. Your changes are really helping me understand what's happening, ...
6 years, 11 months ago (2014-01-08 19:33:41 UTC) #11
rlarocque
Fixed a few things. I've also started working on a separate patch for scopedptr-izing the ...
6 years, 11 months ago (2014-01-09 00:31:17 UTC) #12
rlarocque
https://codereview.chromium.org/93433006/diff/450001/sync/engine/updater_list.h File sync/engine/updater_list.h (right): https://codereview.chromium.org/93433006/diff/450001/sync/engine/updater_list.h#newcode43 sync/engine/updater_list.h:43: class SYNC_EXPORT_PRIVATE UpdaterList { On 2014/01/09 00:31:18, rlarocque wrote: ...
6 years, 11 months ago (2014-01-09 05:10:38 UTC) #13
rlarocque
Ping, I think? I'm not sure what the status of this patch is. I've got ...
6 years, 11 months ago (2014-01-10 21:59:29 UTC) #14
tim (not reviewing)
The main remaining point of contention, I think, is that I still believe the RegisterType ...
6 years, 11 months ago (2014-01-10 23:56:09 UTC) #15
rlarocque
Here's my understanding of this morning's discussion. There are three things to be done here. ...
6 years, 11 months ago (2014-01-14 01:24:50 UTC) #16
tim (not reviewing)
Just one comment about ownership that may have been less clear during our discussion yesterday. ...
6 years, 11 months ago (2014-01-14 20:26:46 UTC) #17
rlarocque
Patch updated. PTAL. https://codereview.chromium.org/93433006/diff/980001/sync/sessions/sync_session_context.h File sync/sessions/sync_session_context.h (right): https://codereview.chromium.org/93433006/diff/980001/sync/sessions/sync_session_context.h#newcode171 sync/sessions/sync_session_context.h:171: scoped_ptr<UpdaterList> updater_list_; On 2014/01/14 20:26:46, timsteele ...
6 years, 11 months ago (2014-01-15 01:16:46 UTC) #18
tim (not reviewing)
Yup. Aside from 1) renaming UpdaterList to GetUpdatesProcessor 2) moving ModelTypeRegistry to sessions/ 3) maybe ...
6 years, 11 months ago (2014-01-15 18:02:58 UTC) #19
rlarocque
On 2014/01/15 18:02:58, timsteele wrote: > Yup. Aside from > > 1) renaming UpdaterList to ...
6 years, 11 months ago (2014-01-16 00:34:34 UTC) #20
rlarocque
On 2014/01/16 00:34:34, rlarocque wrote: > On 2014/01/15 18:02:58, timsteele wrote: > > Yup. Aside ...
6 years, 11 months ago (2014-01-16 00:35:13 UTC) #21
rlarocque
On 2014/01/16 00:35:13, rlarocque wrote: > On 2014/01/16 00:34:34, rlarocque wrote: > > On 2014/01/15 ...
6 years, 11 months ago (2014-01-16 00:46:14 UTC) #22
tim (not reviewing)
LGTM, contingent on: 1) addressing comments below 2) a future CL to sort out ProcessUpdatesUtil, ...
6 years, 11 months ago (2014-01-16 18:28:22 UTC) #23
rlarocque
I've uploaded a new CL to address Tim's latest comments. I agree very much that ...
6 years, 11 months ago (2014-01-16 20:28:41 UTC) #24
Nicolas Zea
LGTM with nits https://codereview.chromium.org/93433006/diff/1190001/sync/engine/get_updates_processor.cc File sync/engine/get_updates_processor.cc (right): https://codereview.chromium.org/93433006/diff/1190001/sync/engine/get_updates_processor.cc#newcode33 sync/engine/get_updates_processor.cc:33: namespace { optional nit: I find ...
6 years, 11 months ago (2014-01-16 21:08:25 UTC) #25
rlarocque
Addressed nits and updated the patch. I'll start running it against the trybots to make ...
6 years, 11 months ago (2014-01-16 21:51:28 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rlarocque@chromium.org/93433006/1320001
6 years, 11 months ago (2014-01-17 21:35:22 UTC) #27
commit-bot: I haz the power
6 years, 11 months ago (2014-01-17 23:22:01 UTC) #28
Message was sent while issue was closed.
Change committed as 245654

Powered by Google App Engine
This is Rietveld 408576698