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

Unified Diff: chrome/browser/autocomplete/network_action_predictor_database.cc

Issue 8566018: Cope with a race condition in NetworkActionPredictor and NetworkActionPredictorDB initialization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « chrome/browser/autocomplete/autocomplete_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/network_action_predictor_database.cc
diff --git a/chrome/browser/autocomplete/network_action_predictor_database.cc b/chrome/browser/autocomplete/network_action_predictor_database.cc
index 09b34fb9fa206b6e90b2160256bdddbdd15acf64..ba2a89b525ed56e1d17a56e2fc2b6ca7c266036b 100644
--- a/chrome/browser/autocomplete/network_action_predictor_database.cc
+++ b/chrome/browser/autocomplete/network_action_predictor_database.cc
@@ -89,7 +89,9 @@ NetworkActionPredictorDatabase::~NetworkActionPredictorDatabase() {
void NetworkActionPredictorDatabase::Initialize() {
CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::DB));
- CHECK(!canceled_.IsSet());
+ if (canceled_.IsSet())
Peter Kasting 2011/11/14 22:49:13 Nit: Looks like your practice elsewhere is to add
+ return;
+
db_.set_exclusive_locking();
if (!db_.Open(db_path_)) {
canceled_.Set();
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698