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

Unified Diff: chrome/browser/sync/glue/sync_backend_host.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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/glue/sync_backend_host.cc
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
index ccf8bf65fa0d5eb0b56e3515e465edea028827a2..eb7e18aa8d1f12e4426fdcce50b052b4008cd947 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -415,6 +415,21 @@ void SyncBackendHost::Initialize(
registrar_->GetModelSafeRoutingInfo(&routing_info);
registrar_->GetWorkers(&workers);
+ InternalComponentsFactory::Switches factory_switches = {
+ InternalComponentsFactory::ENCRYPTION_LEGACY,
+ InternalComponentsFactory::BACKOFF_NORMAL
+ };
+
+ CommandLine* cl = CommandLine::ForCurrentProcess();
+ if (cl->HasSwitch(switches::kSyncKeystoreEncryption)) {
rlarocque 2012/08/14 19:54:07 nit: I think this would be more readable if this w
tim (not reviewing) 2012/08/14 20:20:51 The reason I did it this way is because it is most
rlarocque 2012/08/14 21:13:04 I'd rather not hide the processing inside a functi
+ factory_switches.encryption_method =
+ InternalComponentsFactoryImpl::ENCRYPTION_KEYSTORE;
+ }
+ if (cl->HasSwitch(switches::kSyncShortInitialRetryOverride)) {
rlarocque 2012/08/14 19:54:07 same nit here.
+ factory_switches.backoff_override =
+ InternalComponentsFactoryImpl::BACKOFF_SHORT_INITIAL_RETRY_OVERRIDE;
+ }
+
initialization_state_ = CREATING_SYNC_MANAGER;
InitCore(DoInitializeOptions(
sync_thread_.message_loop(),
@@ -433,7 +448,7 @@ void SyncBackendHost::Initialize(
delete_sync_data_folder,
sync_prefs_->GetEncryptionBootstrapToken(),
sync_prefs_->GetKeystoreEncryptionBootstrapToken(),
- new InternalComponentsFactoryImpl(),
+ new InternalComponentsFactoryImpl(factory_switches),
unrecoverable_error_handler,
report_unrecoverable_error_function));
}
@@ -1091,8 +1106,6 @@ void SyncBackendHost::Core::DoInitialize(const DoInitializeOptions& options) {
options.sync_notifier_factory->CreateSyncNotifier())),
options.restored_key_for_bootstrapping,
options.restored_keystore_key_for_bootstrapping,
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kSyncKeystoreEncryption),
scoped_ptr<InternalComponentsFactory>(
options.internal_components_factory),
&encryptor_,

Powered by Google App Engine
This is Rietveld 408576698