diff options
author | stanisc@chromium.org <stanisc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-16 19:03:53 +0000 |
---|---|---|
committer | stanisc@chromium.org <stanisc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-16 19:03:53 +0000 |
commit | 9f0592d333437442fec786a0f137829b15c1f5b6 (patch) | |
tree | 4bd706416005bb9e5227c4de3f319734f3c019ea /components/sync_driver/sync_frontend.h | |
parent | 34b03e206a04ff28dca5577e3c8761c850b2b516 (diff) | |
download | chromium_src-9f0592d333437442fec786a0f137829b15c1f5b6.zip chromium_src-9f0592d333437442fec786a0f137829b15c1f5b6.tar.gz chromium_src-9f0592d333437442fec786a0f137829b15c1f5b6.tar.bz2 |
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.
Review URL: https://codereview.chromium.org/367153005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283461 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/sync_driver/sync_frontend.h')
-rw-r--r-- | components/sync_driver/sync_frontend.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/components/sync_driver/sync_frontend.h b/components/sync_driver/sync_frontend.h index 0a360a8..247d215 100644 --- a/components/sync_driver/sync_frontend.h +++ b/components/sync_driver/sync_frontend.h @@ -48,6 +48,7 @@ class SyncFrontend { const syncer::WeakHandle<syncer::JsBackend>& js_backend, const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& debug_info_listener, + const std::string& cache_guid, bool success) = 0; // The backend queried the server recently and received some updates. |