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

Issue 2641523004: [Sync] Make directory types registration explicit in ModelTypeRegistry (Closed)

Created:
3 years, 11 months ago by pavely
Modified:
3 years, 11 months ago
Reviewers:
maxbogue
CC:
chromium-reviews, sync-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Sync] Make directory types registration explicit in ModelTypeRegistry The goal of this change is to make registration of directory types with ModelTypeRegistry to be driven by individual data type controllers. Today set of directory data types are registered with single call to SetEnabledDirectoryTypes, they are derived from routing info passed through sync manager and scheduler. Since datatype registration will be performed as separate posts to sync thread it is important to switch scheduler to configuration mode at the beginning of configuration. In this change I: - Added Register/UnregisterDirectoryType to ModelTypeConnector and ModelTypeRegistry. - Removed SetEnabledDirectoryTypes form ModelTypeRegistry as it is no longer needed. - Added StartConfiguration to SyncEngine. This method needs to be called before RegisterDirectoryDataType are called so that normal sync cycle doesn't get executed on sync thread and doesn't include new datatypes before their services are ready to receive updates. - Added BeforeLoadModels method to DataTypeController. This method is called right before LoadModels and allows directory datatypes to register with sync engine before initial data downloading begins. BUG=647505 R=maxbogue@chromium.org Review-Url: https://codereview.chromium.org/2641523004 Cr-Commit-Position: refs/heads/master@{#444846} Committed: https://chromium.googlesource.com/chromium/src/+/1c7af89ea2d8e6e5e31be9d1f7bfa6c306584f5d

Patch Set 1 #

Total comments: 14

Patch Set 2 : Address comments #

Total comments: 12

Patch Set 3 : Address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+532 lines, -561 lines) Patch
M components/browser_sync/profile_sync_service.cc View 1 chunk +1 line, -0 lines 0 comments Download
M components/sync/driver/data_type_controller.h View 1 2 1 chunk +6 lines, -0 lines 0 comments Download
M components/sync/driver/data_type_manager_impl.h View 1 chunk +1 line, -0 lines 0 comments Download
M components/sync/driver/data_type_manager_impl.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M components/sync/driver/data_type_manager_impl_unittest.cc View 28 chunks +55 lines, -1 line 0 comments Download
M components/sync/driver/directory_data_type_controller.h View 1 2 2 chunks +9 lines, -5 lines 0 comments Download
M components/sync/driver/directory_data_type_controller.cc View 1 2 2 chunks +25 lines, -19 lines 0 comments Download
M components/sync/driver/glue/sync_backend_host_core.h View 1 chunk +6 lines, -2 lines 0 comments Download
M components/sync/driver/glue/sync_backend_host_core.cc View 1 5 chunks +18 lines, -10 lines 0 comments Download
M components/sync/driver/glue/sync_backend_host_impl.h View 2 chunks +3 lines, -0 lines 0 comments Download
M components/sync/driver/glue/sync_backend_host_impl.cc View 3 chunks +18 lines, -6 lines 0 comments Download
M components/sync/driver/glue/sync_backend_host_impl_unittest.cc View 9 chunks +0 lines, -9 lines 0 comments Download
M components/sync/driver/model_association_manager.h View 1 chunk +4 lines, -0 lines 0 comments Download
M components/sync/driver/model_association_manager.cc View 1 chunk +1 line, -0 lines 0 comments Download
M components/sync/driver/model_association_manager_unittest.cc View 13 chunks +18 lines, -1 line 0 comments Download
M components/sync/driver/model_type_controller.h View 1 2 2 chunks +3 lines, -2 lines 0 comments Download
M components/sync/driver/model_type_controller.cc View 1 2 2 chunks +14 lines, -12 lines 0 comments Download
M components/sync/driver/model_type_controller_unittest.cc View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M components/sync/driver/proxy_data_type_controller.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M components/sync/driver/proxy_data_type_controller.cc View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M components/sync/engine/fake_model_type_connector.h View 1 chunk +4 lines, -2 lines 0 comments Download
M components/sync/engine/fake_model_type_connector.cc View 1 chunk +7 lines, -2 lines 0 comments Download
M components/sync/engine/fake_sync_engine.h View 2 chunks +6 lines, -0 lines 0 comments Download
M components/sync/engine/fake_sync_engine.cc View 2 chunks +7 lines, -0 lines 0 comments Download
M components/sync/engine/fake_sync_manager.h View 1 6 chunks +8 lines, -11 lines 0 comments Download
M components/sync/engine/fake_sync_manager.cc View 1 6 chunks +11 lines, -17 lines 0 comments Download
M components/sync/engine/model_type_configurer.h View 1 chunk +10 lines, -0 lines 0 comments Download
M components/sync/engine/model_type_connector.h View 1 3 chunks +18 lines, -5 lines 0 comments Download
M components/sync/engine/sync_engine.h View 1 chunk +5 lines, -0 lines 0 comments Download
M components/sync/engine/sync_manager.h View 1 2 3 chunks +12 lines, -4 lines 0 comments Download
M components/sync/engine_impl/cycle/sync_cycle.h View 1 chunk +0 lines, -1 line 0 comments Download
M components/sync/engine_impl/cycle/sync_cycle_context.h View 1 chunk +0 lines, -2 lines 0 comments Download
M components/sync/engine_impl/cycle/sync_cycle_context.cc View 1 chunk +0 lines, -5 lines 0 comments Download
M components/sync/engine_impl/model_type_connector_proxy.h View 2 chunks +5 lines, -2 lines 0 comments Download
M components/sync/engine_impl/model_type_connector_proxy.cc View 1 chunk +20 lines, -7 lines 0 comments Download
M components/sync/engine_impl/model_type_registry.h View 4 chunks +12 lines, -11 lines 0 comments Download
M components/sync/engine_impl/model_type_registry.cc View 1 4 chunks +58 lines, -68 lines 0 comments Download
M components/sync/engine_impl/model_type_registry_unittest.cc View 5 chunks +72 lines, -130 lines 0 comments Download
M components/sync/engine_impl/sync_manager_impl.h View 1 2 chunks +3 lines, -3 lines 0 comments Download
M components/sync/engine_impl/sync_manager_impl.cc View 1 4 chunks +11 lines, -11 lines 0 comments Download
M components/sync/engine_impl/sync_manager_impl_unittest.cc View 10 chunks +41 lines, -109 lines 0 comments Download
M components/sync/engine_impl/sync_scheduler.h View 2 chunks +0 lines, -3 lines 0 comments Download
M components/sync/engine_impl/sync_scheduler_impl.cc View 3 chunks +0 lines, -26 lines 0 comments Download
M components/sync/engine_impl/sync_scheduler_impl_unittest.cc View 19 chunks +7 lines, -31 lines 0 comments Download
M components/sync/engine_impl/syncer_unittest.cc View 5 chunks +7 lines, -39 lines 0 comments Download
M components/sync/tools/sync_client.cc View 1 2 chunks +7 lines, -5 lines 0 comments Download

Messages

Total messages: 25 (17 generated)
pavely
3 years, 11 months ago (2017-01-18 00:49:17 UTC) #4
maxbogue
Quick initial pass; I skipped all the test stuff, which I'll look at tomorrow. https://codereview.chromium.org/2641523004/diff/1/components/sync/driver/glue/sync_backend_host_core.cc ...
3 years, 11 months ago (2017-01-18 01:24:12 UTC) #5
pavely
https://codereview.chromium.org/2641523004/diff/1/components/sync/driver/glue/sync_backend_host_core.cc File components/sync/driver/glue/sync_backend_host_core.cc (right): https://codereview.chromium.org/2641523004/diff/1/components/sync/driver/glue/sync_backend_host_core.cc#newcode146 components/sync/driver/glue/sync_backend_host_core.cc:146: // update handlers registerd in ModelTypeRegistry. Register them here. ...
3 years, 11 months ago (2017-01-18 20:18:07 UTC) #10
maxbogue
lgtm! Comments are all little nits :) https://codereview.chromium.org/2641523004/diff/20001/components/sync/driver/data_type_controller.h File components/sync/driver/data_type_controller.h (right): https://codereview.chromium.org/2641523004/diff/20001/components/sync/driver/data_type_controller.h#newcode94 components/sync/driver/data_type_controller.h:94: // Called ...
3 years, 11 months ago (2017-01-19 19:19:55 UTC) #13
pavely
https://codereview.chromium.org/2641523004/diff/20001/components/sync/driver/data_type_controller.h File components/sync/driver/data_type_controller.h (right): https://codereview.chromium.org/2641523004/diff/20001/components/sync/driver/data_type_controller.h#newcode94 components/sync/driver/data_type_controller.h:94: // Called right before LoadModels. This method allows controller ...
3 years, 11 months ago (2017-01-19 20:27:39 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2641523004/40001
3 years, 11 months ago (2017-01-19 21:22:04 UTC) #21
commit-bot: I haz the power
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/1c7af89ea2d8e6e5e31be9d1f7bfa6c306584f5d
3 years, 11 months ago (2017-01-19 21:29:00 UTC) #24
pavely
3 years, 11 months ago (2017-01-20 18:35:04 UTC) #25
Message was sent while issue was closed.
A revert of this CL (patchset #3 id:40001) has been created in
https://codereview.chromium.org/2644373003/ by pavely@chromium.org.

The reason for reverting is: This change causes crashes in sync:
http://crbug.com/682998
.

Powered by Google App Engine
This is Rietveld 408576698