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/base64.h" | 10 #include "base/base64.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 #include "sync/internal_api/public/engine/passive_model_worker.h" | 31 #include "sync/internal_api/public/engine/passive_model_worker.h" |
32 #include "sync/internal_api/public/http_bridge.h" | 32 #include "sync/internal_api/public/http_bridge.h" |
33 #include "sync/internal_api/public/read_node.h" | 33 #include "sync/internal_api/public/read_node.h" |
34 #include "sync/internal_api/public/sync_manager.h" | 34 #include "sync/internal_api/public/sync_manager.h" |
35 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h" | 35 #include "sync/internal_api/public/util/report_unrecoverable_error_function.h" |
36 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" | 36 #include "sync/internal_api/public/util/unrecoverable_error_handler.h" |
37 #include "sync/internal_api/public/util/weak_handle.h" | 37 #include "sync/internal_api/public/util/weak_handle.h" |
38 #include "sync/js/js_event_details.h" | 38 #include "sync/js/js_event_details.h" |
39 #include "sync/js/js_event_handler.h" | 39 #include "sync/js/js_event_handler.h" |
40 #include "sync/notifier/invalidation_state_tracker.h" | 40 #include "sync/notifier/invalidation_state_tracker.h" |
| 41 #include "sync/notifier/sync_notifier.h" |
41 #include "sync/notifier/sync_notifier_factory.h" | 42 #include "sync/notifier/sync_notifier_factory.h" |
42 #include "sync/test/fake_encryptor.h" | 43 #include "sync/test/fake_encryptor.h" |
43 | 44 |
44 #if defined(OS_MACOSX) | 45 #if defined(OS_MACOSX) |
45 #include "base/mac/scoped_nsautorelease_pool.h" | 46 #include "base/mac/scoped_nsautorelease_pool.h" |
46 #endif | 47 #endif |
47 | 48 |
48 // This is a simple utility that initializes a sync client and | 49 // This is a simple utility that initializes a sync client and |
49 // prints out any events. | 50 // prints out any events. |
50 | 51 |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 syncer::SyncManager::NON_TEST; | 348 syncer::SyncManager::NON_TEST; |
348 NullEncryptor null_encryptor; | 349 NullEncryptor null_encryptor; |
349 LoggingUnrecoverableErrorHandler unrecoverable_error_handler; | 350 LoggingUnrecoverableErrorHandler unrecoverable_error_handler; |
350 sync_manager.Init(database_dir.path(), | 351 sync_manager.Init(database_dir.path(), |
351 syncer::WeakHandle<syncer::JsEventHandler>( | 352 syncer::WeakHandle<syncer::JsEventHandler>( |
352 js_event_handler.AsWeakPtr()), | 353 js_event_handler.AsWeakPtr()), |
353 kSyncServerAndPath, | 354 kSyncServerAndPath, |
354 kSyncServerPort, | 355 kSyncServerPort, |
355 kUseSsl, | 356 kUseSsl, |
356 blocking_task_runner, | 357 blocking_task_runner, |
357 post_factory.release(), | 358 post_factory.Pass(), |
358 routing_info, | 359 routing_info, |
359 workers, | 360 workers, |
360 extensions_activity_monitor, | 361 extensions_activity_monitor, |
361 &change_delegate, | 362 &change_delegate, |
362 credentials, | 363 credentials, |
363 sync_notifier_factory.CreateSyncNotifier(), | 364 scoped_ptr<syncer::SyncNotifier>( |
| 365 sync_notifier_factory.CreateSyncNotifier()), |
364 kRestoredKeyForBootstrapping, | 366 kRestoredKeyForBootstrapping, |
365 kTestingMode, | 367 kTestingMode, |
366 &null_encryptor, | 368 &null_encryptor, |
367 &unrecoverable_error_handler, | 369 &unrecoverable_error_handler, |
368 &LogUnrecoverableErrorContext); | 370 &LogUnrecoverableErrorContext); |
369 // TODO(akalin): We have pass in model parameters multiple times. | 371 // TODO(akalin): We have pass in model parameters multiple times. |
370 // Organize handling of model types. | 372 // Organize handling of model types. |
371 sync_manager.UpdateEnabledTypes(model_types); | 373 sync_manager.UpdateEnabledTypes(model_types); |
372 sync_manager.StartSyncingNormally(routing_info); | 374 sync_manager.StartSyncingNormally(routing_info); |
373 | 375 |
374 sync_loop.Run(); | 376 sync_loop.Run(); |
375 | 377 |
376 io_thread.Stop(); | 378 io_thread.Stop(); |
377 return 0; | 379 return 0; |
378 } | 380 } |
OLD | NEW |