| 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 const char kUserAgent[] = "sync_client"; | 338 const char kUserAgent[] = "sync_client"; |
| 339 // TODO(akalin): Replace this with just the context getter once | 339 // TODO(akalin): Replace this with just the context getter once |
| 340 // HttpPostProviderFactory is removed. | 340 // HttpPostProviderFactory is removed. |
| 341 scoped_ptr<HttpPostProviderFactory> post_factory( | 341 scoped_ptr<HttpPostProviderFactory> post_factory( |
| 342 new HttpBridgeFactory(context_getter, kUserAgent)); | 342 new HttpBridgeFactory(context_getter, kUserAgent)); |
| 343 // Used only when committing bookmarks, so it's okay to leave this | 343 // Used only when committing bookmarks, so it's okay to leave this |
| 344 // as NULL. | 344 // as NULL. |
| 345 ExtensionsActivityMonitor* extensions_activity_monitor = NULL; | 345 ExtensionsActivityMonitor* extensions_activity_monitor = NULL; |
| 346 LoggingChangeDelegate change_delegate; | 346 LoggingChangeDelegate change_delegate; |
| 347 const char kRestoredKeyForBootstrapping[] = ""; | 347 const char kRestoredKeyForBootstrapping[] = ""; |
| 348 const char kRestoredKeystoreKeyForBootstrapping[] = ""; |
| 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 WeakHandle<JsEventHandler>( | 352 WeakHandle<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.Pass(), | 358 post_factory.Pass(), |
| 358 workers, | 359 workers, |
| 359 extensions_activity_monitor, | 360 extensions_activity_monitor, |
| 360 &change_delegate, | 361 &change_delegate, |
| 361 credentials, | 362 credentials, |
| 362 scoped_ptr<SyncNotifier>( | 363 scoped_ptr<SyncNotifier>( |
| 363 sync_notifier_factory.CreateSyncNotifier()), | 364 sync_notifier_factory.CreateSyncNotifier()), |
| 364 kRestoredKeyForBootstrapping, | 365 kRestoredKeyForBootstrapping, |
| 366 kRestoredKeystoreKeyForBootstrapping, |
| 365 true, // enable keystore encryption | 367 true, // enable keystore encryption |
| 366 scoped_ptr<InternalComponentsFactory>( | 368 scoped_ptr<InternalComponentsFactory>( |
| 367 new InternalComponentsFactoryImpl()), | 369 new InternalComponentsFactoryImpl()), |
| 368 &null_encryptor, | 370 &null_encryptor, |
| 369 &unrecoverable_error_handler, | 371 &unrecoverable_error_handler, |
| 370 &LogUnrecoverableErrorContext); | 372 &LogUnrecoverableErrorContext); |
| 371 // TODO(akalin): Avoid passing in model parameters multiple times by | 373 // TODO(akalin): Avoid passing in model parameters multiple times by |
| 372 // organizing handling of model types. | 374 // organizing handling of model types. |
| 373 sync_manager->UpdateEnabledTypes(model_types); | 375 sync_manager->UpdateEnabledTypes(model_types); |
| 374 sync_manager->StartSyncingNormally(routing_info); | 376 sync_manager->StartSyncingNormally(routing_info); |
| 375 | 377 |
| 376 sync_loop.Run(); | 378 sync_loop.Run(); |
| 377 | 379 |
| 378 io_thread.Stop(); | 380 io_thread.Stop(); |
| 379 return 0; | 381 return 0; |
| 380 } | 382 } |
| 381 | 383 |
| 382 } // namespace | 384 } // namespace |
| 383 } // namespace syncer | 385 } // namespace syncer |
| 384 | 386 |
| 385 int main(int argc, char* argv[]) { | 387 int main(int argc, char* argv[]) { |
| 386 return syncer::SyncClientMain(argc, argv); | 388 return syncer::SyncClientMain(argc, argv); |
| 387 } | 389 } |
| OLD | NEW |