diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-07 19:19:16 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-07 19:19:16 +0000 |
commit | 08a6f99997bad56869412e1da065acda3dc41538 (patch) | |
tree | cf28f8848aed5fa3f641e8f76380469500efa852 /sync/tools | |
parent | c12229d169345b5ea6fc69cfc4f23d57ac3a9fcc (diff) | |
download | chromium_src-08a6f99997bad56869412e1da065acda3dc41538.zip chromium_src-08a6f99997bad56869412e1da065acda3dc41538.tar.gz chromium_src-08a6f99997bad56869412e1da065acda3dc41538.tar.bz2 |
[Invalidations] Add GetInvalidatorState() to Invalidator{,Frontend}
Combine OnNotifications{Enabled,Disabled}() into OnInvalidatorStateChange(). Replace NotificationsDisabledReason with InvalidatorState.
Rename OnIncomingNotification to OnIncomingInvalidation. Also change
some references of "notification" to "invalidation".
Set the initial invalidator state in ChromeToMobileService. Also remove OnNotificationsEnabled() call from OnIncomingInvalidation().
Instantiate InvalidatorTest template for ProfileSyncService.
Move comments for invalidation-related functions from ProfileSyncService to InvalidatorFrontend.
Put DISALLOW_COPY_AND_ASSIGN on some classes.
Fix comment in invalidator.h.
BUG=142475
TBR=brettw@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10916131
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155448 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/tools')
-rw-r--r-- | sync/tools/sync_listen_notifications.cc | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/sync/tools/sync_listen_notifications.cc b/sync/tools/sync_listen_notifications.cc index 24789fd7..5a832c2 100644 --- a/sync/tools/sync_listen_notifications.cc +++ b/sync/tools/sync_listen_notifications.cc @@ -54,25 +54,20 @@ class NotificationPrinter : public InvalidationHandler { NotificationPrinter() {} virtual ~NotificationPrinter() {} - virtual void OnNotificationsEnabled() OVERRIDE { - LOG(INFO) << "Notifications enabled"; + virtual void OnInvalidatorStateChange(InvalidatorState state) OVERRIDE { + LOG(INFO) << "Invalidator state changed to " + << InvalidatorStateToString(state); } - virtual void OnNotificationsDisabled( - NotificationsDisabledReason reason) OVERRIDE { - LOG(INFO) << "Notifications disabled with reason " - << NotificationsDisabledReasonToString(reason); - } - - virtual void OnIncomingNotification( + virtual void OnIncomingInvalidation( const ObjectIdStateMap& id_state_map, - IncomingNotificationSource source) OVERRIDE { + IncomingInvalidationSource source) OVERRIDE { const ModelTypeStateMap& type_state_map = ObjectIdStateMapToModelTypeStateMap(id_state_map); for (ModelTypeStateMap::const_iterator it = type_state_map.begin(); it != type_state_map.end(); ++it) { - LOG(INFO) << (source == REMOTE_NOTIFICATION ? "Remote" : "Local") - << " Notification: type = " + LOG(INFO) << (source == REMOTE_INVALIDATION ? "Remote" : "Local") + << " Invalidation: type = " << ModelTypeToString(it->first) << ", payload = " << it->second.payload; } |