From 3801e985d672573326e8ab1de6c8f19bbf003494 Mon Sep 17 00:00:00 2001 From: "tim@chromium.org" Date: Thu, 13 Jan 2011 18:47:15 +0000 Subject: sync: avoid creating a HistoryModelWorker unless it is needed. We typically add all known workers when Initializing the SyncBackendHost, but this one is causing crashes and isn't used by default. BUG=53916,69561 TEST=none Review URL: http://codereview.chromium.org/6111012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71337 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/sync/glue/sync_backend_host.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'chrome/browser/sync/glue') diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc index 4dafe24..ed363fc 100644 --- a/chrome/browser/sync/glue/sync_backend_host.cc +++ b/chrome/browser/sync/glue/sync_backend_host.cc @@ -97,12 +97,18 @@ void SyncBackendHost::Initialize( // when a new type is synced as the worker may already exist and you just // need to update routing_info_. registrar_.workers[GROUP_DB] = new DatabaseModelWorker(); - registrar_.workers[GROUP_HISTORY] = - new HistoryModelWorker( - profile_->GetHistoryService(Profile::IMPLICIT_ACCESS)); registrar_.workers[GROUP_UI] = new UIModelWorker(frontend_loop_); registrar_.workers[GROUP_PASSIVE] = new ModelSafeWorker(); + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableSyncTypedUrls) || types.count(syncable::TYPED_URLS)) { + // TODO(tim): Bug 53916. HistoryModelWorker crashes, so avoid adding it + // unless specifically requested until bug is fixed. + registrar_.workers[GROUP_HISTORY] = + new HistoryModelWorker( + profile_->GetHistoryService(Profile::IMPLICIT_ACCESS)); + } + PasswordStore* password_store = profile_->GetPasswordStore(Profile::IMPLICIT_ACCESS); if (password_store) { -- cgit v1.1