| 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 #include <cstdio> | 8 #include <cstdio> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "base/at_exit.h" | 13 #include "base/at_exit.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/debug/stack_trace.h" | 16 #include "base/debug/stack_trace.h" |
| 17 #include "base/files/scoped_temp_dir.h" | 17 #include "base/files/scoped_temp_dir.h" |
| 18 #include "base/json/json_writer.h" | 18 #include "base/json/json_writer.h" |
| 19 #include "base/logging.h" | 19 #include "base/logging.h" |
| 20 #include "base/memory/ptr_util.h" | 20 #include "base/memory/ptr_util.h" |
| 21 #include "base/memory/ref_counted.h" | 21 #include "base/memory/ref_counted.h" |
| 22 #include "base/memory/weak_ptr.h" | 22 #include "base/memory/weak_ptr.h" |
| 23 #include "base/message_loop/message_loop.h" | 23 #include "base/message_loop/message_loop.h" |
| 24 #include "base/rand_util.h" | 24 #include "base/rand_util.h" |
| 25 #include "base/run_loop.h" |
| 25 #include "base/task_runner.h" | 26 #include "base/task_runner.h" |
| 26 #include "base/threading/thread.h" | 27 #include "base/threading/thread.h" |
| 27 #include "build/build_config.h" | 28 #include "build/build_config.h" |
| 28 #include "components/invalidation/impl/non_blocking_invalidator.h" | 29 #include "components/invalidation/impl/non_blocking_invalidator.h" |
| 29 #include "components/invalidation/public/object_id_invalidation_map.h" | 30 #include "components/invalidation/public/object_id_invalidation_map.h" |
| 30 #include "components/sync_driver/invalidation_helper.h" | 31 #include "components/sync_driver/invalidation_helper.h" |
| 31 #include "jingle/notifier/base/notification_method.h" | 32 #include "jingle/notifier/base/notification_method.h" |
| 32 #include "jingle/notifier/base/notifier_options.h" | 33 #include "jingle/notifier/base/notifier_options.h" |
| 33 #include "net/base/host_port_pair.h" | 34 #include "net/base/host_port_pair.h" |
| 34 #include "net/base/network_change_notifier.h" | 35 #include "net/base/network_change_notifier.h" |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 // TODO(akalin): Avoid passing in model parameters multiple times by | 448 // TODO(akalin): Avoid passing in model parameters multiple times by |
| 448 // organizing handling of model types. | 449 // organizing handling of model types. |
| 449 invalidator->UpdateCredentials(credentials.email, credentials.sync_token); | 450 invalidator->UpdateCredentials(credentials.email, credentials.sync_token); |
| 450 std::unique_ptr<InvalidatorShim> shim( | 451 std::unique_ptr<InvalidatorShim> shim( |
| 451 new InvalidatorShim(sync_manager.get())); | 452 new InvalidatorShim(sync_manager.get())); |
| 452 invalidator->RegisterHandler(shim.get()); | 453 invalidator->RegisterHandler(shim.get()); |
| 453 CHECK(invalidator->UpdateRegisteredIds( | 454 CHECK(invalidator->UpdateRegisteredIds( |
| 454 shim.get(), ModelTypeSetToObjectIdSet(model_types))); | 455 shim.get(), ModelTypeSetToObjectIdSet(model_types))); |
| 455 sync_manager->StartSyncingNormally(routing_info, base::Time()); | 456 sync_manager->StartSyncingNormally(routing_info, base::Time()); |
| 456 | 457 |
| 457 sync_loop.Run(); | 458 base::RunLoop().Run(); |
| 458 | 459 |
| 459 io_thread.Stop(); | 460 io_thread.Stop(); |
| 460 return 0; | 461 return 0; |
| 461 } | 462 } |
| 462 | 463 |
| 463 } // namespace | 464 } // namespace |
| 464 } // namespace syncer | 465 } // namespace syncer |
| 465 | 466 |
| 466 int main(int argc, char* argv[]) { | 467 int main(int argc, char* argv[]) { |
| 467 return syncer::SyncClientMain(argc, argv); | 468 return syncer::SyncClientMain(argc, argv); |
| 468 } | 469 } |
| OLD | NEW |