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

Side by Side Diff: sync/tools/sync_listen_notifications.cc

Issue 10824252: Revert 150990 - [Sync] Avoid unregistering object IDs on shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sync/sync.gyp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <cstddef>
6 #include <cstdio> 5 #include <cstdio>
7 #include <string> 6 #include <string>
8 7
9 #include "base/at_exit.h" 8 #include "base/at_exit.h"
10 #include "base/base64.h" 9 #include "base/base64.h"
11 #include "base/command_line.h" 10 #include "base/command_line.h"
12 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
13 #include "base/logging.h" 12 #include "base/logging.h"
14 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
15 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 SyncNotifierFactory sync_notifier_factory( 235 SyncNotifierFactory sync_notifier_factory(
237 notifier_options, kClientInfo, 236 notifier_options, kClientInfo,
238 null_invalidation_state_tracker.AsWeakPtr()); 237 null_invalidation_state_tracker.AsWeakPtr());
239 scoped_ptr<SyncNotifier> sync_notifier( 238 scoped_ptr<SyncNotifier> sync_notifier(
240 sync_notifier_factory.CreateSyncNotifier()); 239 sync_notifier_factory.CreateSyncNotifier());
241 NotificationPrinter notification_printer; 240 NotificationPrinter notification_printer;
242 241
243 const char kUniqueId[] = "fake_unique_id"; 242 const char kUniqueId[] = "fake_unique_id";
244 sync_notifier->SetUniqueId(kUniqueId); 243 sync_notifier->SetUniqueId(kUniqueId);
245 sync_notifier->UpdateCredentials(email, token); 244 sync_notifier->UpdateCredentials(email, token);
246
247 // Listen for notifications for all known types. 245 // Listen for notifications for all known types.
248 sync_notifier->RegisterHandler(&notification_printer);
249 sync_notifier->UpdateRegisteredIds( 246 sync_notifier->UpdateRegisteredIds(
250 &notification_printer, ModelTypeSetToObjectIdSet(ModelTypeSet::All())); 247 &notification_printer, ModelTypeSetToObjectIdSet(ModelTypeSet::All()));
251 248
252 ui_loop.Run(); 249 ui_loop.Run();
253 250
254 sync_notifier->UnregisterHandler(&notification_printer); 251 sync_notifier->UpdateRegisteredIds(&notification_printer, ObjectIdSet());
255 io_thread.Stop(); 252 io_thread.Stop();
256 return 0; 253 return 0;
257 } 254 }
258 255
259 } // namespace 256 } // namespace
260 } // namespace syncer 257 } // namespace syncer
261 258
262 int main(int argc, char* argv[]) { 259 int main(int argc, char* argv[]) {
263 return syncer::SyncListenNotificationsMain(argc, argv); 260 return syncer::SyncListenNotificationsMain(argc, argv);
264 } 261 }
OLDNEW
« no previous file with comments | « sync/sync.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698