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

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

Issue 12847003: Separate invalidator and sync client ID (part 2/2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix sync_listen_notifications utility Created 7 years, 9 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/tools/sync_client.cc ('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> 5 #include <cstddef>
6 #include <cstdio> 6 #include <cstdio>
7 #include <string> 7 #include <string>
8 8
9 #include "base/at_exit.h" 9 #include "base/at_exit.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 new MyTestURLRequestContextGetter(io_thread.message_loop_proxy())); 194 new MyTestURLRequestContextGetter(io_thread.message_loop_proxy()));
195 const char kClientInfo[] = "sync_listen_notifications"; 195 const char kClientInfo[] = "sync_listen_notifications";
196 NullInvalidationStateTracker null_invalidation_state_tracker; 196 NullInvalidationStateTracker null_invalidation_state_tracker;
197 InvalidatorFactory invalidator_factory( 197 InvalidatorFactory invalidator_factory(
198 notifier_options, kClientInfo, 198 notifier_options, kClientInfo,
199 null_invalidation_state_tracker.AsWeakPtr()); 199 null_invalidation_state_tracker.AsWeakPtr());
200 scoped_ptr<Invalidator> invalidator( 200 scoped_ptr<Invalidator> invalidator(
201 invalidator_factory.CreateInvalidator()); 201 invalidator_factory.CreateInvalidator());
202 NotificationPrinter notification_printer; 202 NotificationPrinter notification_printer;
203 203
204 const char kUniqueId[] = "fake_unique_id";
205 invalidator->SetUniqueId(kUniqueId);
206 invalidator->UpdateCredentials(email, token); 204 invalidator->UpdateCredentials(email, token);
207 205
208 // Listen for notifications for all known types. 206 // Listen for notifications for all known types.
209 invalidator->RegisterHandler(&notification_printer); 207 invalidator->RegisterHandler(&notification_printer);
210 invalidator->UpdateRegisteredIds( 208 invalidator->UpdateRegisteredIds(
211 &notification_printer, ModelTypeSetToObjectIdSet(ModelTypeSet::All())); 209 &notification_printer, ModelTypeSetToObjectIdSet(ModelTypeSet::All()));
212 210
213 ui_loop.Run(); 211 ui_loop.Run();
214 212
215 invalidator->UnregisterHandler(&notification_printer); 213 invalidator->UnregisterHandler(&notification_printer);
216 io_thread.Stop(); 214 io_thread.Stop();
217 return 0; 215 return 0;
218 } 216 }
219 217
220 } // namespace 218 } // namespace
221 } // namespace syncer 219 } // namespace syncer
222 220
223 int main(int argc, char* argv[]) { 221 int main(int argc, char* argv[]) {
224 return syncer::SyncListenNotificationsMain(argc, argv); 222 return syncer::SyncListenNotificationsMain(argc, argv);
225 } 223 }
OLDNEW
« no previous file with comments | « sync/tools/sync_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698