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

Unified Diff: chrome/browser/webdata/web_data_service.cc

Issue 8355025: Fix an Autofill crash caused by accessing the g_browser_process on the DB thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix more tests? Created 9 years, 2 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
Index: chrome/browser/webdata/web_data_service.cc
diff --git a/chrome/browser/webdata/web_data_service.cc b/chrome/browser/webdata/web_data_service.cc
index 5d4a09cc9ca8c619c4b9a817cc549234bfe9e085..00ce1c3114ec346a1647f214055335c09ce3703f 100644
--- a/chrome/browser/webdata/web_data_service.cc
+++ b/chrome/browser/webdata/web_data_service.cc
@@ -8,6 +8,7 @@
#include "base/message_loop.h"
#include "base/stl_util.h"
#include "base/threading/thread.h"
+#include "chrome/browser/autofill/autofill_country.h"
#include "chrome/browser/autofill/autofill_profile.h"
#include "chrome/browser/autofill/credit_card.h"
#include "chrome/browser/profiles/profile.h"
@@ -540,6 +541,13 @@ WebDataService::~WebDataService() {
bool WebDataService::InitWithPath(const FilePath& path) {
path_ = path;
is_running_ = true;
+
+ // TODO(isherman): For now, to avoid a data race on shutdown
+ // [ http://crbug.com/100745 ], call |AutofillCountry::ApplicationLocale()| to
+ // cache the application locale before we try to access it on the DB thread.
+ // This should be safe to remove once [ http://crbug.com/100845 ] is fixed.
+ AutofillCountry::ApplicationLocale();
+
ScheduleTask(Bind(&WebDataService::InitializeDatabaseIfNecessary, this));
ScheduleTask(Bind(&WebDataService::InitializeSyncableServices, this));
return true;
« no previous file with comments | « chrome/browser/autofill/phone_number_unittest.cc ('k') | chrome/browser/webdata/web_database_migration_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698