summaryrefslogtreecommitdiffstats
path: root/chrome/browser/password_manager
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-27 19:54:50 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-27 19:54:50 +0000
commit35f7e5399e616c4076a10d9f06d2e97e9880558f (patch)
treec793b0cd91bf5161877ecde1bef1a5fe7ba874c4 /chrome/browser/password_manager
parentc41e051dd15512eb3040d56f9aeea758d505de1d (diff)
downloadchromium_src-35f7e5399e616c4076a10d9f06d2e97e9880558f.zip
chromium_src-35f7e5399e616c4076a10d9f06d2e97e9880558f.tar.gz
chromium_src-35f7e5399e616c4076a10d9f06d2e97e9880558f.tar.bz2
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 <paivanof@gmail.com> 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 <paivanof@gmail.com>. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148788 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/password_manager')
-rw-r--r--chrome/browser/password_manager/password_store_factory.cc13
1 files changed, 9 insertions, 4 deletions
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(