From 35f7e5399e616c4076a10d9f06d2e97e9880558f Mon Sep 17 00:00:00 2001 From: "shess@chromium.org" Date: Fri, 27 Jul 2012 19:54:50 +0000 Subject: Annotate calls to SQLite functions - they have to be executed on a thread allowing IO access. Also expanded scope of ScopedAllowIO in SQLiteServerBoundCertStore::Backend::Load() to cover SQLite functions. And added ScopedAllowIO to PasswordStoreFactory::BuildServiceInstanceFor() -- it calls LoginDatabase::Init() which should be executed on DB thread. This is a reland of https://src.chromium.org/viewvc/chrome?view=rev&revision=147309 which was reverted because of missing ScopedAllowIO in PasswordStoreFactory. Patch from Pavel Ivanov BUG=75232, 52909, 137961, 138903 TEST=no test fails with message "Function marked as IO-only was called from a thread that disallows IO!" Review URL: https://chromiumcodereview.appspot.com/10824008 Patch from Pavel Ivanov . git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148788 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/password_manager/password_store_factory.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'chrome/browser/password_manager') diff --git a/chrome/browser/password_manager/password_store_factory.cc b/chrome/browser/password_manager/password_store_factory.cc index bee596d..b110cb5d 100644 --- a/chrome/browser/password_manager/password_store_factory.cc +++ b/chrome/browser/password_manager/password_store_factory.cc @@ -99,10 +99,15 @@ PasswordStoreFactory::BuildServiceInstanceFor(Profile* profile) const { FilePath login_db_file_path = profile->GetPath(); login_db_file_path = login_db_file_path.Append(chrome::kLoginDataFileName); LoginDatabase* login_db = new LoginDatabase(); - if (!login_db->Init(login_db_file_path)) { - LOG(ERROR) << "Could not initialize login database."; - delete login_db; - return NULL; + { + // TODO(paivanof@gmail.com): execution of login_db->Init() should go + // to DB thread. http://crbug.com/138903 + base::ThreadRestrictions::ScopedAllowIO allow_io; + if (!login_db->Init(login_db_file_path)) { + LOG(ERROR) << "Could not initialize login database."; + delete login_db; + return NULL; + } } #if defined(OS_WIN) ps = new PasswordStoreWin( -- cgit v1.1