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

Issue 367153005: Sync: Refactoring of DEVICE_INFO syncable type - Part 1 (Closed)

Created:
6 years, 5 months ago by stanisc
Modified:
6 years, 5 months ago
CC:
chromium-reviews, tim+watch_chromium.org, extensions-reviews_chromium.org, zea+watch_chromium.org, haitaol+watch_chromium.org, chromium-apps-reviews_chromium.org, maniscalco+watch_chromium.org, pavely
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Sync: Refactoring of DEVICE_INFO syncable type - Part 1 This change introduces a new class LocalDeviceInfoProvider that is responsible for providing the local device specific DeviceInfo/cache_guid. It initializes the data asynchronously and allows consumers to get notified when the data becomes available. LocalDeviceInfoProvider will allow to remove these responsibilities from SyncedDeviceTracker / ProfileSyncService and loose coupling between ProfileSyncService and a number of SyncableService and DataTypeController derived classes. LocalDeviceInfoProvider is hosted on the frontend thread. Since it needs cache_guid to initialize DeviceInfo, which is currently available only on the backend, I updated SyncBackendHostCore and SyncBackendHostImpl to pass cache_guid to the frontend via OnBackendInitialized. For the time being SyncedDeviceTracker remains unchanged and continues to initialize the local device info too. The entire class will be removed in the Part 2 of the change which will move SyncedDeviceTracker functionality to a new SyncableService. LocalDeviceInfoProvider also replaces SessionsSyncManager::SyncInternalApiDelegate which was previously used to decouple SessionsSyncManager from the specifics of of the local device info implementation. SessionsSyncManager is changed to consume LocalDeviceInfoProvider instead of SessionsSyncManager::SyncInternalApiDelegate. SessionDataTypeController now also consumes LocalDeviceInfoProvider to make sure that SESSIONS type model doesn't start before local device info becomes available. A very similar approach will be used in the upcoming second part of the change for DEVICE_INFO DataTypeController and SyncableType. The change includes new unit tests for LocalDeviceInfoProvider and SessionDataTypeController. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=283461

Patch Set 1 : Initial patch #

Total comments: 2

Patch Set 2 : Addressed build issues in browser_tests #

Total comments: 19

Patch Set 3 : Fixed ExtensionSessionsTest test failures #

Total comments: 14

Patch Set 4 : Addressed CR feedback and fixed failing tests #

Patch Set 5 : Fixed MacOS specific build issue in wrench_menu_controller_unittest #

Patch Set 6 : Fixed test issues with mocking of LocalDeviceInfoProvider #

Total comments: 6

Patch Set 7 : Use scoped_ptr for ProfileSyncComponentsFactory, addressed other CR feedback. #

Patch Set 8 : Fixed scoped_ptr issue in ProfileSyncService constructor #

Unified diffs Side-by-side diffs Delta from patch set Stats (+893 lines, -189 lines) Patch
M chrome/browser/extensions/api/preferences_private/preferences_private_apitest.cc View 1 2 3 4 5 6 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/sessions/sessions_apitest.cc View 1 2 3 4 5 6 5 chunks +25 lines, -10 lines 0 comments Download
M chrome/browser/extensions/api/signed_in_devices/signed_in_devices_api.cc View 3 chunks +6 lines, -1 line 0 comments Download
A chrome/browser/sync/glue/local_device_info_provider.h View 1 2 3 1 chunk +48 lines, -0 lines 0 comments Download
A chrome/browser/sync/glue/local_device_info_provider_impl.h View 1 2 3 1 chunk +39 lines, -0 lines 0 comments Download
A chrome/browser/sync/glue/local_device_info_provider_impl.cc View 1 2 3 1 chunk +58 lines, -0 lines 0 comments Download
A chrome/browser/sync/glue/local_device_info_provider_mock.h View 1 2 3 4 5 1 chunk +43 lines, -0 lines 0 comments Download
A chrome/browser/sync/glue/local_device_info_provider_mock.cc View 1 2 3 4 5 1 chunk +58 lines, -0 lines 0 comments Download
A chrome/browser/sync/glue/local_device_info_provider_unittest.cc View 1 2 3 1 chunk +82 lines, -0 lines 0 comments Download
M chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc View 1 2 3 4 5 1 chunk +1 line, -2 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host_core.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/sync_backend_host_impl.h View 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/sync_backend_host_impl.cc View 3 chunks +4 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/sync_backend_host_impl_unittest.cc View 2 chunks +3 lines, -2 lines 0 comments Download
M chrome/browser/sync/glue/sync_backend_host_mock.cc View 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_components_factory.h View 1 2 3 4 5 6 2 chunks +5 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_components_factory_impl.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_components_factory_impl.cc View 1 2 3 3 chunks +12 lines, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc View 1 2 3 4 5 6 2 chunks +14 lines, -12 lines 0 comments Download
M chrome/browser/sync/profile_sync_components_factory_mock.h View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/browser/sync/profile_sync_components_factory_mock.cc View 1 2 3 4 5 4 chunks +17 lines, -1 line 0 comments Download
M chrome/browser/sync/profile_sync_service.h View 1 2 3 4 5 6 7 chunks +12 lines, -15 lines 0 comments Download
M chrome/browser/sync/profile_sync_service.cc View 1 2 3 4 5 6 7 7 chunks +18 lines, -23 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_factory.cc View 1 2 3 4 5 6 1 chunk +7 lines, -5 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_mock.h View 1 2 3 4 5 6 3 chunks +4 lines, -7 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_mock.cc View 1 2 3 4 5 6 3 chunks +15 lines, -6 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_startup_unittest.cc View 1 2 3 4 5 6 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/sync/profile_sync_service_unittest.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/sync/sessions/session_data_type_controller.h View 3 chunks +21 lines, -1 line 0 comments Download
M chrome/browser/sync/sessions/session_data_type_controller.cc View 1 2 3 6 chunks +42 lines, -5 lines 0 comments Download
A chrome/browser/sync/sessions/session_data_type_controller_unittest.cc View 1 2 3 1 chunk +233 lines, -0 lines 0 comments Download
M chrome/browser/sync/sessions/sessions_sync_manager.h View 1 2 3 4 chunks +6 lines, -15 lines 0 comments Download
M chrome/browser/sync/sessions/sessions_sync_manager.cc View 1 2 3 6 chunks +26 lines, -8 lines 0 comments Download
M chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc View 6 chunks +18 lines, -17 lines 0 comments Download
M chrome/browser/sync/test_profile_sync_service.h View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test_profile_sync_service.cc View 1 2 3 4 5 6 2 chunks +9 lines, -9 lines 0 comments Download
M chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller_unittest.mm View 1 2 3 4 5 6 5 chunks +15 lines, -17 lines 0 comments Download
M chrome/browser/ui/sync/one_click_signin_helper_unittest.cc View 1 2 3 4 5 6 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/ui/sync/one_click_signin_sync_observer_unittest.cc View 1 2 3 4 5 6 2 chunks +3 lines, -1 line 0 comments Download
M chrome/browser/ui/toolbar/recent_tabs_sub_menu_model_unittest.cc View 1 2 3 4 5 6 4 chunks +11 lines, -19 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 4 chunks +6 lines, -2 lines 0 comments Download
M components/sync_driver/sync_frontend.h View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
stanisc
6 years, 5 months ago (2014-07-07 18:58:21 UTC) #1
rlarocque
https://codereview.chromium.org/367153005/diff/1/chrome/browser/sync/sessions/session_data_type_controller_unittest.cc File chrome/browser/sync/sessions/session_data_type_controller_unittest.cc (right): https://codereview.chromium.org/367153005/diff/1/chrome/browser/sync/sessions/session_data_type_controller_unittest.cc#newcode123 chrome/browser/sync/sessions/session_data_type_controller_unittest.cc:123: EXPECT_FALSE(error.IsSet()); I dislike putting assertions in functions, because it ...
6 years, 5 months ago (2014-07-08 18:25:38 UTC) #2
maniscalco
(some drive by comments; feel free to reject if they conflict with comments from your ...
6 years, 5 months ago (2014-07-08 21:17:53 UTC) #3
stanisc
https://codereview.chromium.org/367153005/diff/1/chrome/browser/sync/sessions/session_data_type_controller_unittest.cc File chrome/browser/sync/sessions/session_data_type_controller_unittest.cc (right): https://codereview.chromium.org/367153005/diff/1/chrome/browser/sync/sessions/session_data_type_controller_unittest.cc#newcode123 chrome/browser/sync/sessions/session_data_type_controller_unittest.cc:123: EXPECT_FALSE(error.IsSet()); On 2014/07/08 18:25:37, rlarocque wrote: > I dislike ...
6 years, 5 months ago (2014-07-09 21:58:37 UTC) #4
maniscalco
https://codereview.chromium.org/367153005/diff/20001/chrome/browser/sync/glue/local_device_info_provider_mock.h File chrome/browser/sync/glue/local_device_info_provider_mock.h (right): https://codereview.chromium.org/367153005/diff/20001/chrome/browser/sync/glue/local_device_info_provider_mock.h#newcode13 chrome/browser/sync/glue/local_device_info_provider_mock.h:13: class LocalDeviceInfoProviderMock : public LocalDeviceInfoProvider { You're right, it's ...
6 years, 5 months ago (2014-07-09 22:47:34 UTC) #5
rlarocque
lgtm
6 years, 5 months ago (2014-07-09 23:01:50 UTC) #6
stanisc
I had a couple more small patches to address an issue with one Mac specific ...
6 years, 5 months ago (2014-07-10 21:22:24 UTC) #7
stanisc
The CQ bit was checked by stanisc@chromium.org
6 years, 5 months ago (2014-07-10 21:38:07 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/stanisc@chromium.org/367153005/100001
6 years, 5 months ago (2014-07-10 21:41:17 UTC) #9
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: chromium_presubmit on tryserver.chromium ...
6 years, 5 months ago (2014-07-10 23:25:46 UTC) #10
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-10 23:29:42 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/chromium_presubmit/builds/79264)
6 years, 5 months ago (2014-07-10 23:29:43 UTC) #12
stanisc
Need additional OWNER reviewers for a few files. Nick, please review: chrome/browser/ui/sync/one_click_signin_helper_unittest.cc chrome/browser/ui/sync/one_click_signin_sync_observer_unittest.cc Scott, please ...
6 years, 5 months ago (2014-07-10 23:52:34 UTC) #13
maniscalco
c/b/ui/sync lgtm
6 years, 5 months ago (2014-07-11 00:00:00 UTC) #14
sky
https://codereview.chromium.org/367153005/diff/100001/chrome/browser/extensions/api/preferences_private/preferences_private_apitest.cc File chrome/browser/extensions/api/preferences_private/preferences_private_apitest.cc (right): https://codereview.chromium.org/367153005/diff/100001/chrome/browser/extensions/api/preferences_private/preferences_private_apitest.cc#newcode46 chrome/browser/extensions/api/preferences_private/preferences_private_apitest.cc:46: new ProfileSyncComponentsFactoryMock(), Can the constructor take a scoped_ptr so ...
6 years, 5 months ago (2014-07-14 19:33:34 UTC) #15
stanisc
Addressed the latest CR feedback including changing ProfileSyncService to take scoped_ptr<ProfileSyncComponentsFactory> rather than ProfileSyncComponentsFactory*. https://codereview.chromium.org/367153005/diff/100001/chrome/browser/extensions/api/preferences_private/preferences_private_apitest.cc ...
6 years, 5 months ago (2014-07-14 22:49:05 UTC) #16
rlarocque
+CC Pavel, since he's working on changes near this code.
6 years, 5 months ago (2014-07-15 00:04:31 UTC) #17
sky
Set of files you asked me to review LGTM
6 years, 5 months ago (2014-07-15 04:32:43 UTC) #18
stanisc
The CQ bit was checked by stanisc@chromium.org
6 years, 5 months ago (2014-07-16 17:56:44 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/stanisc@chromium.org/367153005/140001
6 years, 5 months ago (2014-07-16 17:58:59 UTC) #20
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: ios_rel_device_ninja on tryserver.chromium ...
6 years, 5 months ago (2014-07-16 18:52:49 UTC) #21
commit-bot: I haz the power
Change committed as 283461
6 years, 5 months ago (2014-07-16 19:03:56 UTC) #22
kuan
6 years, 5 months ago (2014-07-16 19:57:50 UTC) #23
Message was sent while issue was closed.
A revert of this CL has been created in
https://codereview.chromium.org/401433003/ by kuan@chromium.org.

The reason for reverting is: this broke unit_tests" on "Linux ASan LSan Tests
(2):
http://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%20LSan%20Te....

Powered by Google App Engine
This is Rietveld 408576698