diff options
author | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-30 06:25:04 +0000 |
---|---|---|
committer | rlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-30 06:25:04 +0000 |
commit | 674112fbf399a598535a32ef4cfbf97a1377a7ac (patch) | |
tree | d0815096dd92cf8f7afc3e6dd01d47c203514852 /sync/internal_api/test | |
parent | 4f4b047e6d00780b0bffb739d493304c5373bcf6 (diff) | |
download | chromium_src-674112fbf399a598535a32ef4cfbf97a1377a7ac.zip chromium_src-674112fbf399a598535a32ef4cfbf97a1377a7ac.tar.gz chromium_src-674112fbf399a598535a32ef4cfbf97a1377a7ac.tar.bz2 |
Separate local and remote sync invalidations
The old design used ChromeSyncNotificationsBridge to register for both
NOTIFICATION_SYNC_REFRESH_LOCAL and NOTIFICATION_SYNC_REFRESH_REMOTE.
The first of these is issued when some component decides that the syncer
ought to perform an unsolicited GetUpdates for some type, while the
second is an Android-specific mechanism for receiving remote
invalidations. In either case, the ChromeSyncNotificationsBridge would
forward the invalidations to the SyncManager through the
BridgedInvalidator as though they had come from any other invalidator.
In this new design, the local and remote invalidations sources are kept
distinct. The SyncBackendHost is now responsible for listening to and
forwarding NOTIFICATION_SYNC_REFRESH_LOCAL. Note that there is no
longer any type-specific filtering performed as we receive
notifications; it will be up to the SyncManager to ignore notifications
for disbaled types.
The successor to ChromeSyncNotificationsBridge,
AndroidInvalidatorBridge, is responsible only for forwarding
NOTIFICATION_SYNC_REFRESH_REMOTE notificaitons. It is passed to the
SyncManager only if OS_ANDROID is defined.
Since there is only one source of remote invalidations, the
BridgedInvalidator would seem to be no longer necessary. Unfortunately,
this is not the case. The BridgedInvalidator was useful in part because
it wrapped the UI-thread-owned ChromeSyncNotificationsBridge without
owning it, so the SyncManager's destruction would not affect it. This
wrapping functionality is still needed by the AndroidInvalidatorBridge.
The BridgedInvalidator has been modified to only wrap a single
AndroidInvalidatorBridge, and renamed to AndroidInvalidatorBridgeProxy.
BUG=124143
Review URL: https://chromiumcodereview.appspot.com/12022041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179546 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/test')
-rw-r--r-- | sync/internal_api/test/fake_sync_manager.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sync/internal_api/test/fake_sync_manager.cc b/sync/internal_api/test/fake_sync_manager.cc index e07c8e7..25335fd 100644 --- a/sync/internal_api/test/fake_sync_manager.cc +++ b/sync/internal_api/test/fake_sync_manager.cc @@ -271,6 +271,10 @@ SyncEncryptionHandler* FakeSyncManager::GetEncryptionHandler() { return fake_encryption_handler_.get(); } +void FakeSyncManager::RefreshTypes(ModelTypeSet types) { + last_refresh_request_types_ = types; +} + void FakeSyncManager::InvalidateOnSyncThread( const ObjectIdInvalidationMap& invalidation_map, IncomingInvalidationSource source) { @@ -284,4 +288,8 @@ void FakeSyncManager::UpdateInvalidatorStateOnSyncThread( registrar_.UpdateInvalidatorState(state); } +ModelTypeSet FakeSyncManager::GetLastRefreshRequestTypes() { + return last_refresh_request_types_; +} + } // namespace syncer |