Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: sync/tools/sync_client.cc

Issue 10837231: sync: add InternalComponentsFactory::Switches to simplify passing switches to internal components. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pass switches in test_profile_sync_service.cc Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 scoped_ptr<HttpPostProviderFactory> post_factory( 344 scoped_ptr<HttpPostProviderFactory> post_factory(
345 new HttpBridgeFactory(context_getter, kUserAgent)); 345 new HttpBridgeFactory(context_getter, kUserAgent));
346 // Used only when committing bookmarks, so it's okay to leave this 346 // Used only when committing bookmarks, so it's okay to leave this
347 // as NULL. 347 // as NULL.
348 ExtensionsActivityMonitor* extensions_activity_monitor = NULL; 348 ExtensionsActivityMonitor* extensions_activity_monitor = NULL;
349 LoggingChangeDelegate change_delegate; 349 LoggingChangeDelegate change_delegate;
350 const char kRestoredKeyForBootstrapping[] = ""; 350 const char kRestoredKeyForBootstrapping[] = "";
351 const char kRestoredKeystoreKeyForBootstrapping[] = ""; 351 const char kRestoredKeystoreKeyForBootstrapping[] = "";
352 NullEncryptor null_encryptor; 352 NullEncryptor null_encryptor;
353 LoggingUnrecoverableErrorHandler unrecoverable_error_handler; 353 LoggingUnrecoverableErrorHandler unrecoverable_error_handler;
354 InternalComponentsFactoryImpl::Switches factory_switches = {
355 InternalComponentsFactory::ENCRYPTION_KEYSTORE,
356 InternalComponentsFactory::BACKOFF_NORMAL
357 };
358
354 sync_manager->Init(database_dir.path(), 359 sync_manager->Init(database_dir.path(),
355 WeakHandle<JsEventHandler>( 360 WeakHandle<JsEventHandler>(
356 js_event_handler.AsWeakPtr()), 361 js_event_handler.AsWeakPtr()),
357 kSyncServerAndPath, 362 kSyncServerAndPath,
358 kSyncServerPort, 363 kSyncServerPort,
359 kUseSsl, 364 kUseSsl,
360 blocking_task_runner, 365 blocking_task_runner,
361 post_factory.Pass(), 366 post_factory.Pass(),
362 workers, 367 workers,
363 extensions_activity_monitor, 368 extensions_activity_monitor,
364 &change_delegate, 369 &change_delegate,
365 credentials, 370 credentials,
366 scoped_ptr<SyncNotifier>( 371 scoped_ptr<SyncNotifier>(
367 sync_notifier_factory.CreateSyncNotifier()), 372 sync_notifier_factory.CreateSyncNotifier()),
368 kRestoredKeyForBootstrapping, 373 kRestoredKeyForBootstrapping,
369 kRestoredKeystoreKeyForBootstrapping, 374 kRestoredKeystoreKeyForBootstrapping,
370 true, // enable keystore encryption
371 scoped_ptr<InternalComponentsFactory>( 375 scoped_ptr<InternalComponentsFactory>(
372 new InternalComponentsFactoryImpl()), 376 new InternalComponentsFactoryImpl(factory_switches)),
373 &null_encryptor, 377 &null_encryptor,
374 &unrecoverable_error_handler, 378 &unrecoverable_error_handler,
375 &LogUnrecoverableErrorContext); 379 &LogUnrecoverableErrorContext);
376 // TODO(akalin): Avoid passing in model parameters multiple times by 380 // TODO(akalin): Avoid passing in model parameters multiple times by
377 // organizing handling of model types. 381 // organizing handling of model types.
378 sync_manager->UpdateEnabledTypes(model_types); 382 sync_manager->UpdateEnabledTypes(model_types);
379 sync_manager->StartSyncingNormally(routing_info); 383 sync_manager->StartSyncingNormally(routing_info);
380 384
381 sync_loop.Run(); 385 sync_loop.Run();
382 386
383 io_thread.Stop(); 387 io_thread.Stop();
384 return 0; 388 return 0;
385 } 389 }
386 390
387 } // namespace 391 } // namespace
388 } // namespace syncer 392 } // namespace syncer
389 393
390 int main(int argc, char* argv[]) { 394 int main(int argc, char* argv[]) {
391 return syncer::SyncClientMain(argc, argv); 395 return syncer::SyncClientMain(argc, argv);
392 } 396 }
OLDNEW
« sync/internal_api/public/internal_components_factory.h ('K') | « sync/sync.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698