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

Issue 1314903004: Sync: Refactoring DataTypeController to make the design shareable with USS datatypes. (Closed)

Created:
5 years, 3 months ago by stanisc
Modified:
5 years, 3 months ago
Reviewers:
Nicolas Zea
CC:
chromium-reviews, tim+watch_chromium.org, pvalenzuela+watch_chromium.org, maxbogue+watch_chromium.org, plaree+watch_chromium.org, zea+watch_chromium.org, maxbogue, pavely, Gang Wu
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Sync: Refactoring DataTypeController to make the design shareable with USS datatypes. 1) Moved the code that activates and deactivates datatypes from DataTypeManager to DataTypeController. This should allow controllers to implement the activation differently from directory based and USS datatypes. 2) Removed any directory specific code from DataTypeManager and DataTypeController and made theme generic enough to work for USS datatypes. More specifically: - GetChangeProcessor() and model_safe_group() are moved to DirectoryDataTypeController - see below. - OnUserShareChanged(), user_share() are not needed anymore. 3) Introduced new base class for directory based DTC - DirectoryDataTypeController. This class provides directory specific implementation for the datatype activation/deactivation and declares some directory specific virtual functions that formerly were in DataTypeController. 4) Changed the mechanism how some specific DTC get the user share. Instead of being pushed to each DTC, user share can now be accessed via SyncClient which is already passed to each controller. I had to fix some mock classes and test code to make it work for all tests. BUG=515962 Committed: https://crrev.com/de3d02a6ecdc7dcf7cfcf1c9c596777172568e78 Cr-Commit-Position: refs/heads/master@{#347111}

Patch Set 1 #

Patch Set 2 : Merged with recent changes #

Patch Set 3 : Fixed build error in unit_tests #

Patch Set 4 : Removed UserShare from DTC #

Patch Set 5 : Fixed unit tests that use FakeSyncClient #

Patch Set 6 : Fixing build on Android #

Total comments: 12

Patch Set 7 : Addressed CR comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+216 lines, -136 lines) Patch
M chrome/browser/sync/glue/bookmark_model_associator.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/bookmark_model_associator.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/sync/glue/non_frontend_data_type_controller.h View 1 2 3 4 5 6 2 chunks +4 lines, -3 lines 0 comments Download
M chrome/browser/sync/glue/non_frontend_data_type_controller.cc View 1 2 3 4 5 6 2 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/sync/profile_sync_components_factory_impl.h View 1 2 3 1 chunk +1 line, -4 lines 0 comments Download
M chrome/browser/sync/profile_sync_service.h View 1 2 3 4 5 6 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_service.cc View 1 2 3 4 5 6 1 chunk +0 lines, -8 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_autofill_unittest.cc View 1 2 3 4 5 6 4 chunks +11 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_bookmark_unittest.cc View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/sync/test/integration/profile_sync_service_harness.cc View 1 2 3 1 chunk +0 lines, -1 line 0 comments Download
M components/sync_driver.gypi View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M components/sync_driver/BUILD.gn View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M components/sync_driver/data_type_controller.h View 1 2 3 4 5 6 8 chunks +15 lines, -28 lines 0 comments Download
M components/sync_driver/data_type_controller.cc View 1 2 3 4 5 6 2 chunks +2 lines, -12 lines 0 comments Download
M components/sync_driver/data_type_controller_mock.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M components/sync_driver/data_type_error_handler_mock.h View 1 1 chunk +1 line, -1 line 0 comments Download
M components/sync_driver/data_type_manager_impl.cc View 1 3 chunks +7 lines, -6 lines 0 comments Download
M components/sync_driver/data_type_manager_impl_unittest.cc View 1 1 chunk +0 lines, -1 line 0 comments Download
A components/sync_driver/directory_data_type_controller.h View 1 2 3 4 5 6 1 chunk +51 lines, -0 lines 0 comments Download
A components/sync_driver/directory_data_type_controller.cc View 1 2 3 4 5 6 1 chunk +31 lines, -0 lines 0 comments Download
M components/sync_driver/fake_data_type_controller.h View 2 chunks +2 lines, -2 lines 0 comments Download
M components/sync_driver/fake_data_type_controller.cc View 1 2 3 2 chunks +7 lines, -6 lines 0 comments Download
M components/sync_driver/fake_sync_client.h View 1 2 3 4 2 chunks +2 lines, -0 lines 0 comments Download
M components/sync_driver/fake_sync_client.cc View 1 2 3 4 1 chunk +7 lines, -3 lines 0 comments Download
M components/sync_driver/fake_sync_service.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M components/sync_driver/fake_sync_service.cc View 1 2 3 4 2 chunks +4 lines, -3 lines 0 comments Download
M components/sync_driver/frontend_data_type_controller.h View 1 2 3 4 5 6 2 chunks +4 lines, -3 lines 0 comments Download
M components/sync_driver/frontend_data_type_controller.cc View 1 2 3 4 5 6 2 chunks +6 lines, -5 lines 0 comments Download
M components/sync_driver/generic_change_processor.h View 1 1 chunk +0 lines, -1 line 0 comments Download
M components/sync_driver/model_association_manager.cc View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M components/sync_driver/non_ui_data_type_controller.h View 1 2 3 4 5 6 2 chunks +3 lines, -3 lines 0 comments Download
M components/sync_driver/non_ui_data_type_controller.cc View 1 2 3 4 5 6 4 chunks +11 lines, -11 lines 0 comments Download
M components/sync_driver/non_ui_data_type_controller_unittest.cc View 1 2 3 4 3 chunks +4 lines, -2 lines 0 comments Download
M components/sync_driver/proxy_data_type_controller.h View 1 2 3 4 5 6 2 chunks +3 lines, -3 lines 0 comments Download
M components/sync_driver/proxy_data_type_controller.cc View 1 2 3 4 5 6 3 chunks +9 lines, -10 lines 0 comments Download
M components/sync_driver/ui_data_type_controller.h View 1 2 3 4 5 6 2 chunks +3 lines, -3 lines 0 comments Download
M components/sync_driver/ui_data_type_controller.cc View 1 2 3 4 5 6 3 chunks +10 lines, -11 lines 0 comments Download

Messages

Total messages: 11 (5 generated)
stanisc
zea@, made you the primary reviewers since this leverages your recent refactoring changes. gangwu@, maxbogue@, ...
5 years, 3 months ago (2015-09-02 17:27:05 UTC) #4
Nicolas Zea
LGTM! https://codereview.chromium.org/1314903004/diff/100001/chrome/browser/sync/profile_sync_service.h File chrome/browser/sync/profile_sync_service.h (right): https://codereview.chromium.org/1314903004/diff/100001/chrome/browser/sync/profile_sync_service.h#newcode341 chrome/browser/sync/profile_sync_service.h:341: // TODO: this should merge with RegisterDataTypeController On ...
5 years, 3 months ago (2015-09-02 22:52:46 UTC) #5
stanisc
https://codereview.chromium.org/1314903004/diff/100001/chrome/browser/sync/profile_sync_service.h File chrome/browser/sync/profile_sync_service.h (right): https://codereview.chromium.org/1314903004/diff/100001/chrome/browser/sync/profile_sync_service.h#newcode341 chrome/browser/sync/profile_sync_service.h:341: // TODO: this should merge with RegisterDataTypeController On 2015/09/02 ...
5 years, 3 months ago (2015-09-03 01:17:43 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1314903004/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1314903004/120001
5 years, 3 months ago (2015-09-03 04:10:31 UTC) #9
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 3 months ago (2015-09-03 04:15:13 UTC) #10
commit-bot: I haz the power
5 years, 3 months ago (2015-09-03 04:16:14 UTC) #11
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/de3d02a6ecdc7dcf7cfcf1c9c596777172568e78
Cr-Commit-Position: refs/heads/master@{#347111}

Powered by Google App Engine
This is Rietveld 408576698