summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net/sqlite_server_bound_cert_store.cc
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/net/sqlite_server_bound_cert_store.cc
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/net/sqlite_server_bound_cert_store.cc')
-rw-r--r--chrome/browser/net/sqlite_server_bound_cert_store.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/chrome/browser/net/sqlite_server_bound_cert_store.cc b/chrome/browser/net/sqlite_server_bound_cert_store.cc
index 0a297ee..75f9318 100644
--- a/chrome/browser/net/sqlite_server_bound_cert_store.cc
+++ b/chrome/browser/net/sqlite_server_bound_cert_store.cc
@@ -159,16 +159,16 @@ bool SQLiteServerBoundCertStore::Backend::Load(
// This function should be called only once per instance.
DCHECK(!db_.get());
+ // TODO(paivanof@gmail.com): We do a lot of disk access in this function,
+ // thus we do an exception to allow IO on the UI thread. This code will be
+ // moved to the DB thread as part of http://crbug.com/89665.
+ base::ThreadRestrictions::ScopedAllowIO allow_io;
+
// Ensure the parent directory for storing certs is created before reading
- // from it. We make an exception to allow IO on the UI thread here because
- // we are going to disk anyway in db_->Open. (This code will be moved to the
- // DB thread as part of http://crbug.com/52909.)
- {
- base::ThreadRestrictions::ScopedAllowIO allow_io;
- const FilePath dir = path_.DirName();
- if (!file_util::PathExists(dir) && !file_util::CreateDirectory(dir))
- return false;
- }
+ // from it.
+ const FilePath dir = path_.DirName();
+ if (!file_util::PathExists(dir) && !file_util::CreateDirectory(dir))
+ return false;
db_.reset(new sql::Connection);
if (!db_->Open(path_)) {