diff options
author | albertb@chromium.org <albertb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 17:58:22 +0000 |
---|---|---|
committer | albertb@chromium.org <albertb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-10 17:58:22 +0000 |
commit | 6049ef9eb7322b0051b8358b48f5a665ef022331 (patch) | |
tree | fa9228a24c9413539002a042767c83dff483ca2e | |
parent | 4535a2b25d3b6e3a331bbec8df1068c3d3f11b82 (diff) | |
download | chromium_src-6049ef9eb7322b0051b8358b48f5a665ef022331.zip chromium_src-6049ef9eb7322b0051b8358b48f5a665ef022331.tar.gz chromium_src-6049ef9eb7322b0051b8358b48f5a665ef022331.tar.bz2 |
Don't start the PasswordModelWorker if there's no PasswordStore.
BUG=52367
TEST=none
Review URL: http://codereview.chromium.org/3368010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59114 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/sync/glue/password_model_worker.cc | 1 | ||||
-rw-r--r-- | chrome/browser/sync/glue/sync_backend_host.cc | 12 |
2 files changed, 10 insertions, 3 deletions
diff --git a/chrome/browser/sync/glue/password_model_worker.cc b/chrome/browser/sync/glue/password_model_worker.cc index e09c2c5..9c5b0d6 100644 --- a/chrome/browser/sync/glue/password_model_worker.cc +++ b/chrome/browser/sync/glue/password_model_worker.cc @@ -16,6 +16,7 @@ namespace browser_sync { PasswordModelWorker::PasswordModelWorker(PasswordStore* password_store) : password_store_(password_store) { + DCHECK(password_store); } void PasswordModelWorker::DoWorkAndWaitUntilDone(Callback0::Type* work) { diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc index 8da9fc2..56c8b86 100644 --- a/chrome/browser/sync/glue/sync_backend_host.cc +++ b/chrome/browser/sync/glue/sync_backend_host.cc @@ -95,9 +95,15 @@ void SyncBackendHost::Initialize( profile_->GetHistoryService(Profile::IMPLICIT_ACCESS)); registrar_.workers[GROUP_UI] = new UIModelWorker(frontend_loop_); registrar_.workers[GROUP_PASSIVE] = new ModelSafeWorker(); - registrar_.workers[GROUP_PASSWORD] = - new PasswordModelWorker( - profile_->GetPasswordStore(Profile::IMPLICIT_ACCESS)); + + PasswordStore* password_store = + profile_->GetPasswordStore(Profile::IMPLICIT_ACCESS); + if (password_store) { + registrar_.workers[GROUP_PASSWORD] = + new PasswordModelWorker(password_store); + } else { + LOG(ERROR) << "Password store not initialized, cannot sync passwords"; + } // Any datatypes that we want the syncer to pull down must // be in the routing_info map. We set them to group passive, meaning that |