Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1651)

Unified Diff: chrome/browser/net/sqlite_server_bound_cert_store.cc

Issue 10824008: Annotate calls to SQLite functions - they have to be executed on a thread allowing IO access. (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/password_manager/password_store_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/sqlite_server_bound_cert_store.cc
===================================================================
--- chrome/browser/net/sqlite_server_bound_cert_store.cc (revision 147715)
+++ chrome/browser/net/sqlite_server_bound_cert_store.cc (working copy)
@@ -159,16 +159,16 @@
// 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_)) {
« no previous file with comments | « no previous file | chrome/browser/password_manager/password_store_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698