Index: sync/tools/sync_listen_notifications.cc |
diff --git a/sync/tools/sync_listen_notifications.cc b/sync/tools/sync_listen_notifications.cc |
index 5eb05b68f56ffb3c1eab700f990e7ce4348efee5..6d8adb0fba856a1537bdbef84ecb61ec2a7c6c11 100644 |
--- a/sync/tools/sync_listen_notifications.cc |
+++ b/sync/tools/sync_listen_notifications.cc |
@@ -2,6 +2,7 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include <cstddef> |
#include <cstdio> |
#include <string> |
@@ -242,13 +243,15 @@ int SyncListenNotificationsMain(int argc, char* argv[]) { |
const char kUniqueId[] = "fake_unique_id"; |
sync_notifier->SetUniqueId(kUniqueId); |
sync_notifier->UpdateCredentials(email, token); |
+ |
// Listen for notifications for all known types. |
+ sync_notifier->RegisterHandler(¬ification_printer); |
sync_notifier->UpdateRegisteredIds( |
¬ification_printer, ModelTypeSetToObjectIdSet(ModelTypeSet::All())); |
ui_loop.Run(); |
- sync_notifier->UpdateRegisteredIds(¬ification_printer, ObjectIdSet()); |
+ sync_notifier->UnregisterHandler(¬ification_printer); |
io_thread.Stop(); |
return 0; |
} |