diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-18 20:44:26 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-18 20:44:26 +0000 |
commit | 8262829e7be657d706c69795df33649600922029 (patch) | |
tree | f0ec67c619470a3fd5a0f75a6c3dd22ad153b4d1 /chrome/browser/net/sqlite_server_bound_cert_store.cc | |
parent | 5a53501df8894373cc60d6eb3d46aad4e5139ff8 (diff) | |
download | chromium_src-8262829e7be657d706c69795df33649600922029.zip chromium_src-8262829e7be657d706c69795df33649600922029.tar.gz chromium_src-8262829e7be657d706c69795df33649600922029.tar.bz2 |
Annotate calls to SQLite functions - they have to be executed on a thread allowing IO access.
Expand scope of ScopedAllowIO in the only place where SQLite functions are used on UI thread.
Patch from Pavel Ivanov <paivanof@gmail.com>
BUG=75232,52909
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/10540155
Patch from Pavel Ivanov <paivanof@gmail.com>.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147309 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.cc | 18 |
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_)) { |