| 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 workers.push_back(passive_model_safe_worker.get()); | 333 workers.push_back(passive_model_safe_worker.get()); |
| 334 | 334 |
| 335 // Set up sync manager. | 335 // Set up sync manager. |
| 336 SyncManagerFactory sync_manager_factory; | 336 SyncManagerFactory sync_manager_factory; |
| 337 scoped_ptr<SyncManager> sync_manager = | 337 scoped_ptr<SyncManager> sync_manager = |
| 338 sync_manager_factory.CreateSyncManager("sync_client manager"); | 338 sync_manager_factory.CreateSyncManager("sync_client manager"); |
| 339 LoggingJsEventHandler js_event_handler; | 339 LoggingJsEventHandler js_event_handler; |
| 340 const char kSyncServerAndPath[] = "clients4.google.com/chrome-sync/dev"; | 340 const char kSyncServerAndPath[] = "clients4.google.com/chrome-sync/dev"; |
| 341 int kSyncServerPort = 443; | 341 int kSyncServerPort = 443; |
| 342 bool kUseSsl = true; | 342 bool kUseSsl = true; |
| 343 // Used only by RefreshNigori(), so it's okay to leave this as NULL. | 343 // Used only by InitialProcessMetadata(), so it's okay to leave this as NULL. |
| 344 const scoped_refptr<base::TaskRunner> blocking_task_runner = NULL; | 344 const scoped_refptr<base::TaskRunner> blocking_task_runner = NULL; |
| 345 const char kUserAgent[] = "sync_client"; | 345 const char kUserAgent[] = "sync_client"; |
| 346 // TODO(akalin): Replace this with just the context getter once | 346 // TODO(akalin): Replace this with just the context getter once |
| 347 // HttpPostProviderFactory is removed. | 347 // HttpPostProviderFactory is removed. |
| 348 scoped_ptr<HttpPostProviderFactory> post_factory( | 348 scoped_ptr<HttpPostProviderFactory> post_factory( |
| 349 new HttpBridgeFactory(context_getter, kUserAgent)); | 349 new HttpBridgeFactory(context_getter, kUserAgent)); |
| 350 // Used only when committing bookmarks, so it's okay to leave this | 350 // Used only when committing bookmarks, so it's okay to leave this |
| 351 // as NULL. | 351 // as NULL. |
| 352 ExtensionsActivityMonitor* extensions_activity_monitor = NULL; | 352 ExtensionsActivityMonitor* extensions_activity_monitor = NULL; |
| 353 LoggingChangeDelegate change_delegate; | 353 LoggingChangeDelegate change_delegate; |
| 354 const char kRestoredKeyForBootstrapping[] = ""; | 354 const char kRestoredKeyForBootstrapping[] = ""; |
| 355 const char kRestoredKeystoreKeyForBootstrapping[] = ""; | 355 const char kRestoredKeystoreKeyForBootstrapping[] = ""; |
| 356 NullEncryptor null_encryptor; | 356 NullEncryptor null_encryptor; |
| 357 LoggingUnrecoverableErrorHandler unrecoverable_error_handler; | 357 LoggingUnrecoverableErrorHandler unrecoverable_error_handler; |
| 358 InternalComponentsFactoryImpl::Switches factory_switches = { | 358 InternalComponentsFactoryImpl::Switches factory_switches = { |
| 359 InternalComponentsFactory::ENCRYPTION_KEYSTORE, | 359 InternalComponentsFactory::ENCRYPTION_KEYSTORE, |
| 360 InternalComponentsFactory::BACKOFF_NORMAL | 360 InternalComponentsFactory::BACKOFF_NORMAL |
| 361 }; | 361 }; |
| 362 | 362 |
| 363 sync_manager->Init(database_dir.path(), | 363 sync_manager->Init(database_dir.path(), |
| 364 WeakHandle<JsEventHandler>( | 364 WeakHandle<JsEventHandler>( |
| 365 js_event_handler.AsWeakPtr()), | 365 js_event_handler.AsWeakPtr()), |
| 366 kSyncServerAndPath, | 366 kSyncServerAndPath, |
| 367 kSyncServerPort, | 367 kSyncServerPort, |
| 368 kUseSsl, | 368 kUseSsl, |
| 369 blocking_task_runner, | |
| 370 post_factory.Pass(), | 369 post_factory.Pass(), |
| 371 workers, | 370 workers, |
| 372 extensions_activity_monitor, | 371 extensions_activity_monitor, |
| 373 &change_delegate, | 372 &change_delegate, |
| 374 credentials, | 373 credentials, |
| 375 scoped_ptr<Invalidator>( | 374 scoped_ptr<Invalidator>( |
| 376 invalidator_factory.CreateInvalidator()), | 375 invalidator_factory.CreateInvalidator()), |
| 377 kRestoredKeyForBootstrapping, | 376 kRestoredKeyForBootstrapping, |
| 378 kRestoredKeystoreKeyForBootstrapping, | 377 kRestoredKeystoreKeyForBootstrapping, |
| 379 scoped_ptr<InternalComponentsFactory>( | 378 scoped_ptr<InternalComponentsFactory>( |
| (...skipping 11 matching lines...) Expand all Loading... |
| 391 io_thread.Stop(); | 390 io_thread.Stop(); |
| 392 return 0; | 391 return 0; |
| 393 } | 392 } |
| 394 | 393 |
| 395 } // namespace | 394 } // namespace |
| 396 } // namespace syncer | 395 } // namespace syncer |
| 397 | 396 |
| 398 int main(int argc, char* argv[]) { | 397 int main(int argc, char* argv[]) { |
| 399 return syncer::SyncClientMain(argc, argv); | 398 return syncer::SyncClientMain(argc, argv); |
| 400 } | 399 } |
| OLD | NEW |