| OLD | NEW |
| 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 Loading... |
| 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(¬ification_printer); | 207 invalidator->RegisterHandler(¬ification_printer); |
| 210 invalidator->UpdateRegisteredIds( | 208 invalidator->UpdateRegisteredIds( |
| 211 ¬ification_printer, ModelTypeSetToObjectIdSet(ModelTypeSet::All())); | 209 ¬ification_printer, ModelTypeSetToObjectIdSet(ModelTypeSet::All())); |
| 212 | 210 |
| 213 ui_loop.Run(); | 211 ui_loop.Run(); |
| 214 | 212 |
| 215 invalidator->UnregisterHandler(¬ification_printer); | 213 invalidator->UnregisterHandler(¬ification_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 } |
| OLD | NEW |