diff options
author | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-12 16:34:37 +0000 |
---|---|---|
committer | isherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-12 16:34:37 +0000 |
commit | b938d4f552356e79b96a7ecca85d98c782e2c659 (patch) | |
tree | b5e744dae048c8caaee10bcf61cf3c2027cbf9e8 /chrome/browser/webdata/web_data_service.cc | |
parent | a383b35847acaea23b5cb9bfa80ee048638d8901 (diff) | |
download | chromium_src-b938d4f552356e79b96a7ecca85d98c782e2c659.zip chromium_src-b938d4f552356e79b96a7ecca85d98c782e2c659.tar.gz chromium_src-b938d4f552356e79b96a7ecca85d98c782e2c659.tar.bz2 |
[Autofill] Access the application locale in a thread-safe manner when migrating WebDB data.
BUG=100845
TBR=robertshield@chromium.org
Review URL: https://chromiumcodereview.appspot.com/11821044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176539 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/webdata/web_data_service.cc')
-rw-r--r-- | chrome/browser/webdata/web_data_service.cc | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/chrome/browser/webdata/web_data_service.cc b/chrome/browser/webdata/web_data_service.cc index 685b5f3..7428bfa 100644 --- a/chrome/browser/webdata/web_data_service.cc +++ b/chrome/browser/webdata/web_data_service.cc @@ -80,6 +80,7 @@ WDKeywordsResult::~WDKeywordsResult() {} WebDataService::WebDataService() : is_running_(false), db_(NULL), + app_locale_(AutofillCountry::ApplicationLocale()), autocomplete_syncable_service_(NULL), autofill_profile_syncable_service_(NULL), failed_init_(false), @@ -527,14 +528,6 @@ 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. - // Do not do it if the thread is not UI (can happen only in some tests). - if (BrowserThread::CurrentlyOn(BrowserThread::UI)) - AutofillCountry::ApplicationLocale(); - ScheduleTask(FROM_HERE, Bind(&WebDataService::InitializeDatabaseIfNecessary, this)); ScheduleTask(FROM_HERE, @@ -567,7 +560,7 @@ void WebDataService::InitializeDatabaseIfNecessary() { // we only set db_ to the created database if creation is successful. That // way other methods won't do anything as db_ is still NULL. WebDatabase* db = new WebDatabase(); - sql::InitStatus init_status = db->Init(path_); + sql::InitStatus init_status = db->Init(path_, app_locale_); if (init_status != sql::INIT_OK) { LOG(ERROR) << "Cannot initialize the web database: " << init_status; failed_init_ = true; |