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

Unified Diff: sync/tools/sync_listen_notifications.cc

Issue 10702074: Refactor sync-specific parts out of SyncNotifier/SyncNotifierObserver (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: FOR_THE_HORDE Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« sync/notifier/sync_notifier_helper_unittest.cc ('K') | « sync/sync.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/tools/sync_listen_notifications.cc
diff --git a/sync/tools/sync_listen_notifications.cc b/sync/tools/sync_listen_notifications.cc
index 25ebcbdae1b9ae9bbbbf2eec3b8e573330cb4f9a..22b22d6d6d2025c819e913b8c4c6fa63621335da 100644
--- a/sync/tools/sync_listen_notifications.cc
+++ b/sync/tools/sync_listen_notifications.cc
@@ -63,8 +63,10 @@ class NotificationPrinter : public SyncNotifierObserver {
}
virtual void OnIncomingNotification(
- const ModelTypePayloadMap& type_payloads,
+ const ObjectIdPayloadMap& id_payloads,
IncomingNotificationSource source) OVERRIDE {
+ const ModelTypePayloadMap& type_payloads =
+ ObjectIdPayloadMapToModelTypePayloadMap(id_payloads);
for (ModelTypePayloadMap::const_iterator it =
type_payloads.begin(); it != type_payloads.end(); ++it) {
LOG(INFO) << (source == REMOTE_NOTIFICATION ? "Remote" : "Local")
@@ -233,17 +235,17 @@ int SyncListenNotificationsMain(int argc, char* argv[]) {
scoped_ptr<SyncNotifier> sync_notifier(
sync_notifier_factory.CreateSyncNotifier());
NotificationPrinter notification_printer;
- sync_notifier->AddObserver(&notification_printer);
const char kUniqueId[] = "fake_unique_id";
sync_notifier->SetUniqueId(kUniqueId);
sync_notifier->UpdateCredentials(email, token);
// Listen for notifications for all known types.
- sync_notifier->UpdateEnabledTypes(ModelTypeSet::All());
+ sync_notifier->UpdateRegisteredIds(
+ &notification_printer, ModelTypeSetToObjectIdSet(ModelTypeSet::All()));
ui_loop.Run();
- sync_notifier->RemoveObserver(&notification_printer);
+ sync_notifier->UpdateRegisteredIds(&notification_printer, ObjectIdSet());
io_thread.Stop();
return 0;
}
« sync/notifier/sync_notifier_helper_unittest.cc ('K') | « sync/sync.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698