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

Unified Diff: sync/tools/sync_listen_notifications.cc

Issue 10824161: [Sync] Avoid unregistering object IDs on shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 4 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
Index: sync/tools/sync_listen_notifications.cc
diff --git a/sync/tools/sync_listen_notifications.cc b/sync/tools/sync_listen_notifications.cc
index 22b22d6d6d2025c819e913b8c4c6fa63621335da..768303aa8cfe1f1ac2f1684fab30ba46a7100937 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>
msw 2012/08/03 23:30:46 ditto same basictypes nit/q
akalin 2012/08/07 07:25:19 ditto.
#include <cstdio>
#include <string>
@@ -239,13 +240,16 @@ 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.
+ const char kHandlerName[] = "sync_listen_notifications";
+ sync_notifier->SetHandler(kHandlerName, &notification_printer);
sync_notifier->UpdateRegisteredIds(
- &notification_printer, ModelTypeSetToObjectIdSet(ModelTypeSet::All()));
+ kHandlerName, ModelTypeSetToObjectIdSet(ModelTypeSet::All()));
ui_loop.Run();
- sync_notifier->UpdateRegisteredIds(&notification_printer, ObjectIdSet());
+ sync_notifier->SetHandler(kHandlerName, NULL);
io_thread.Stop();
return 0;
}
« sync/notifier/sync_notifier_helper.cc ('K') | « sync/notifier/sync_notifier_helper_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698