summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcaitkp@chromium.org <caitkp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-02 03:40:10 +0000
committercaitkp@chromium.org <caitkp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-02 03:40:10 +0000
commitf4285bf1f508b230ac62f4d2f7d223549f43b4bf (patch)
tree1e44cc2d5985a9b611859657c97fe0d7f680dee7
parent714038ece806a35d13df8647ec7ac0900de46360 (diff)
downloadchromium_src-f4285bf1f508b230ac62f4d2f7d223549f43b4bf.zip
chromium_src-f4285bf1f508b230ac62f4d2f7d223549f43b4bf.tar.gz
chromium_src-f4285bf1f508b230ac62f4d2f7d223549f43b4bf.tar.bz2
Pass app_locale directly to AutofillTable
(instead of sending it on a tour of *all* the WebData classes). TBR=rrobertshield@chromium.org (chrome-frame test fix) BUG=181277 Review URL: https://chromiumcodereview.appspot.com/13191007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191759 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/password_manager/password_store_win_unittest.cc3
-rw-r--r--chrome/browser/webdata/autofill_table.cc11
-rw-r--r--chrome/browser/webdata/autofill_table.h10
-rw-r--r--chrome/browser/webdata/autofill_table_unittest.cc2
-rw-r--r--chrome/browser/webdata/keyword_table.cc1
-rw-r--r--chrome/browser/webdata/keyword_table.h1
-rw-r--r--chrome/browser/webdata/keyword_table_unittest.cc2
-rw-r--r--chrome/browser/webdata/logins_table.cc1
-rw-r--r--chrome/browser/webdata/logins_table.h1
-rw-r--r--chrome/browser/webdata/token_service_table.cc1
-rw-r--r--chrome/browser/webdata/token_service_table.h1
-rw-r--r--chrome/browser/webdata/token_service_table_unittest.cc2
-rw-r--r--chrome/browser/webdata/web_apps_table.cc1
-rw-r--r--chrome/browser/webdata/web_apps_table.h1
-rw-r--r--chrome/browser/webdata/web_apps_table_unittest.cc2
-rw-r--r--chrome/browser/webdata/web_data_service_factory.cc3
-rw-r--r--chrome/browser/webdata/web_data_service_unittest.cc2
-rw-r--r--chrome/browser/webdata/web_database.cc11
-rw-r--r--chrome/browser/webdata/web_database.h10
-rw-r--r--chrome/browser/webdata/web_database_migration_unittest.cc2
-rw-r--r--chrome/browser/webdata/web_database_service.cc24
-rw-r--r--chrome/browser/webdata/web_database_service.h11
-rw-r--r--chrome/browser/webdata/web_database_table.h4
-rw-r--r--chrome/browser/webdata/web_intents_table.cc1
-rw-r--r--chrome/browser/webdata/web_intents_table.h1
-rw-r--r--chrome_frame/test/delete_chrome_history_test.cc2
26 files changed, 37 insertions, 74 deletions
diff --git a/chrome/browser/password_manager/password_store_win_unittest.cc b/chrome/browser/password_manager/password_store_win_unittest.cc
index 3cbe720..84426b9 100644
--- a/chrome/browser/password_manager/password_store_win_unittest.cc
+++ b/chrome/browser/password_manager/password_store_win_unittest.cc
@@ -25,7 +25,6 @@
#include "chrome/browser/webdata/web_database_service.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_profile.h"
-#include "components/autofill/browser/autofill_country.h"
#include "content/public/test/test_browser_thread.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -118,7 +117,7 @@ class PasswordStoreWinTest : public testing::Test {
ASSERT_TRUE(login_db_->Init(temp_dir_.path().Append(
FILE_PATH_LITERAL("login_test"))));
base::FilePath path = temp_dir_.path().AppendASCII("web_data_test");
- wdbs_ = new WebDatabaseService(path, AutofillCountry::ApplicationLocale());
+ wdbs_ = new WebDatabaseService(path);
// Need to add at least one table so the database gets created.
wdbs_->AddTable(scoped_ptr<WebDatabaseTable>(new LoginsTable()));
wdbs_->LoadDatabase(WebDatabaseService::InitCallback());
diff --git a/chrome/browser/webdata/autofill_table.cc b/chrome/browser/webdata/autofill_table.cc
index caf477c..462cfd0 100644
--- a/chrome/browser/webdata/autofill_table.cc
+++ b/chrome/browser/webdata/autofill_table.cc
@@ -331,7 +331,8 @@ WebDatabaseTable::TypeKey GetKey() {
// The maximum length allowed for form data.
const size_t AutofillTable::kMaxDataLength = 1024;
-AutofillTable::AutofillTable() {
+AutofillTable::AutofillTable()
+ : app_locale_(AutofillCountry::ApplicationLocale()) {
}
AutofillTable::~AutofillTable() {
@@ -358,7 +359,6 @@ bool AutofillTable::IsSyncable() {
}
bool AutofillTable::MigrateToVersion(int version,
- const std::string& app_locale,
bool* update_compatible_version) {
// Migrate if necessary.
switch (version) {
@@ -385,7 +385,7 @@ bool AutofillTable::MigrateToVersion(int version,
return MigrateToVersion33ProfilesBasedOnFirstName();
case 34:
*update_compatible_version = true;
- return MigrateToVersion34ProfilesBasedOnCountryCode(app_locale);
+ return MigrateToVersion34ProfilesBasedOnCountryCode();
case 35:
*update_compatible_version = true;
return MigrateToVersion35GreatBritainCountryCodes();
@@ -1927,8 +1927,7 @@ bool AutofillTable::MigrateToVersion33ProfilesBasedOnFirstName() {
// we need a migration. It is possible that the new |autofill_profiles|
// schema is in place because the table was newly created when migrating
// from a pre-version-22 database.
-bool AutofillTable::MigrateToVersion34ProfilesBasedOnCountryCode(
- const std::string& app_locale) {
+bool AutofillTable::MigrateToVersion34ProfilesBasedOnCountryCode() {
if (!db_->DoesColumnExist("autofill_profiles", "country_code")) {
if (!db_->Execute("ALTER TABLE autofill_profiles ADD COLUMN "
"country_code VARCHAR")) {
@@ -1946,7 +1945,7 @@ bool AutofillTable::MigrateToVersion34ProfilesBasedOnCountryCode(
string16 country = s.ColumnString16(1);
update_s.BindString(0, AutofillCountry::GetCountryCode(country,
- app_locale));
+ app_locale_));
update_s.BindString(1, s.ColumnString(0));
if (!update_s.Run())
diff --git a/chrome/browser/webdata/autofill_table.h b/chrome/browser/webdata/autofill_table.h
index b2197ee..7635940 100644
--- a/chrome/browser/webdata/autofill_table.h
+++ b/chrome/browser/webdata/autofill_table.h
@@ -125,7 +125,6 @@ class AutofillTable : public WebDatabaseTable {
virtual bool Init(sql::Connection* db, sql::MetaTable* meta_table) OVERRIDE;
virtual bool IsSyncable() OVERRIDE;
virtual bool MigrateToVersion(int version,
- const std::string& app_locale,
bool* update_compatible_version) OVERRIDE;
// Records the form elements in |elements| in the database in the
@@ -298,8 +297,7 @@ class AutofillTable : public WebDatabaseTable {
bool MigrateToVersion31AddGUIDToCreditCardsAndProfiles();
bool MigrateToVersion32UpdateProfilesAndCreditCards();
bool MigrateToVersion33ProfilesBasedOnFirstName();
- bool MigrateToVersion34ProfilesBasedOnCountryCode(
- const std::string& app_locale);
+ bool MigrateToVersion34ProfilesBasedOnCountryCode();
bool MigrateToVersion35GreatBritainCountryCodes();
bool MigrateToVersion37MergeAndCullOlderProfiles();
@@ -356,6 +354,12 @@ class AutofillTable : public WebDatabaseTable {
bool InitProfilePhonesTable();
bool InitProfileTrashTable();
+ // The application locale. The locale is needed for the migration to version
+ // 35. Since it must be read on the UI thread, it is set when the table is
+ // created (on the UI thread), and cached here so that it can be used for
+ // migrations (on the DB thread).
+ std::string app_locale_;
+
DISALLOW_COPY_AND_ASSIGN(AutofillTable);
};
diff --git a/chrome/browser/webdata/autofill_table_unittest.cc b/chrome/browser/webdata/autofill_table_unittest.cc
index d1263ed..91e4f4e 100644
--- a/chrome/browser/webdata/autofill_table_unittest.cc
+++ b/chrome/browser/webdata/autofill_table_unittest.cc
@@ -101,7 +101,7 @@ class AutofillTableTest : public testing::Test {
table_.reset(new AutofillTable);
db_.reset(new WebDatabase);
db_->AddTable(table_.get());
- ASSERT_EQ(sql::INIT_OK, db_->Init(file_, std::string()));
+ ASSERT_EQ(sql::INIT_OK, db_->Init(file_));
}
static AutofillEntry MakeAutofillEntry(const char* name,
diff --git a/chrome/browser/webdata/keyword_table.cc b/chrome/browser/webdata/keyword_table.cc
index d412d84..3b1413d 100644
--- a/chrome/browser/webdata/keyword_table.cc
+++ b/chrome/browser/webdata/keyword_table.cc
@@ -167,7 +167,6 @@ bool KeywordTable::IsSyncable() {
}
bool KeywordTable::MigrateToVersion(int version,
- const std::string& app_locale,
bool* update_compatible_version) {
// Migrate if necessary.
switch (version) {
diff --git a/chrome/browser/webdata/keyword_table.h b/chrome/browser/webdata/keyword_table.h
index 5cee197..49fc52c 100644
--- a/chrome/browser/webdata/keyword_table.h
+++ b/chrome/browser/webdata/keyword_table.h
@@ -82,7 +82,6 @@ class KeywordTable : public WebDatabaseTable {
virtual bool Init(sql::Connection* db, sql::MetaTable* meta_table) OVERRIDE;
virtual bool IsSyncable() OVERRIDE;
virtual bool MigrateToVersion(int version,
- const std::string& app_locale,
bool* update_compatible_version) OVERRIDE;
// Adds a new keyword, updating the id field on success.
diff --git a/chrome/browser/webdata/keyword_table_unittest.cc b/chrome/browser/webdata/keyword_table_unittest.cc
index 9520f8b..4d86c3d 100644
--- a/chrome/browser/webdata/keyword_table_unittest.cc
+++ b/chrome/browser/webdata/keyword_table_unittest.cc
@@ -34,7 +34,7 @@ class KeywordTableTest : public testing::Test {
table_.reset(new KeywordTable);
db_.reset(new WebDatabase);
db_->AddTable(table_.get());
- ASSERT_EQ(sql::INIT_OK, db_->Init(file_, std::string()));
+ ASSERT_EQ(sql::INIT_OK, db_->Init(file_));
}
base::FilePath file_;
diff --git a/chrome/browser/webdata/logins_table.cc b/chrome/browser/webdata/logins_table.cc
index e97bfdc..a202672 100644
--- a/chrome/browser/webdata/logins_table.cc
+++ b/chrome/browser/webdata/logins_table.cc
@@ -64,7 +64,6 @@ bool LoginsTable::IsSyncable() {
}
bool LoginsTable::MigrateToVersion(int version,
- const std::string& app_locale,
bool* update_compatible_version) {
return true;
}
diff --git a/chrome/browser/webdata/logins_table.h b/chrome/browser/webdata/logins_table.h
index e035609..8e451cf 100644
--- a/chrome/browser/webdata/logins_table.h
+++ b/chrome/browser/webdata/logins_table.h
@@ -32,7 +32,6 @@ class LoginsTable : public WebDatabaseTable {
virtual bool Init(sql::Connection* db, sql::MetaTable* meta_table) OVERRIDE;
virtual bool IsSyncable() OVERRIDE;
virtual bool MigrateToVersion(int version,
- const std::string& app_locale,
bool* update_compatible_version) OVERRIDE;
#if defined(OS_WIN)
diff --git a/chrome/browser/webdata/token_service_table.cc b/chrome/browser/webdata/token_service_table.cc
index 8ffe82d..eb79c92 100644
--- a/chrome/browser/webdata/token_service_table.cc
+++ b/chrome/browser/webdata/token_service_table.cc
@@ -49,7 +49,6 @@ bool TokenServiceTable::IsSyncable() {
}
bool TokenServiceTable::MigrateToVersion(int version,
- const std::string& app_locale,
bool* update_compatible_version) {
return true;
}
diff --git a/chrome/browser/webdata/token_service_table.h b/chrome/browser/webdata/token_service_table.h
index b75ec0b..4ab4041 100644
--- a/chrome/browser/webdata/token_service_table.h
+++ b/chrome/browser/webdata/token_service_table.h
@@ -25,7 +25,6 @@ class TokenServiceTable : public WebDatabaseTable {
virtual bool Init(sql::Connection* db, sql::MetaTable* meta_table) OVERRIDE;
virtual bool IsSyncable() OVERRIDE;
virtual bool MigrateToVersion(int version,
- const std::string& app_locale,
bool* update_compatible_version) OVERRIDE;
// Remove all tokens previously set with SetTokenForService.
diff --git a/chrome/browser/webdata/token_service_table_unittest.cc b/chrome/browser/webdata/token_service_table_unittest.cc
index 2030fe5..4e2beb2 100644
--- a/chrome/browser/webdata/token_service_table_unittest.cc
+++ b/chrome/browser/webdata/token_service_table_unittest.cc
@@ -26,7 +26,7 @@ class TokenServiceTableTest : public testing::Test {
table_.reset(new TokenServiceTable);
db_.reset(new WebDatabase);
db_->AddTable(table_.get());
- ASSERT_EQ(sql::INIT_OK, db_->Init(file_, std::string()));
+ ASSERT_EQ(sql::INIT_OK, db_->Init(file_));
}
base::FilePath file_;
diff --git a/chrome/browser/webdata/web_apps_table.cc b/chrome/browser/webdata/web_apps_table.cc
index ffa8cb0..ba0a433 100644
--- a/chrome/browser/webdata/web_apps_table.cc
+++ b/chrome/browser/webdata/web_apps_table.cc
@@ -41,7 +41,6 @@ bool WebAppsTable::IsSyncable() {
}
bool WebAppsTable::MigrateToVersion(int version,
- const std::string& app_locale,
bool* update_compatible_version) {
return true;
}
diff --git a/chrome/browser/webdata/web_apps_table.h b/chrome/browser/webdata/web_apps_table.h
index 1f80f50..8c73f94 100644
--- a/chrome/browser/webdata/web_apps_table.h
+++ b/chrome/browser/webdata/web_apps_table.h
@@ -41,7 +41,6 @@ class WebAppsTable : public WebDatabaseTable {
virtual bool Init(sql::Connection* db, sql::MetaTable* meta_table) OVERRIDE;
virtual bool IsSyncable() OVERRIDE;
virtual bool MigrateToVersion(int version,
- const std::string& app_locale,
bool* update_compatible_version) OVERRIDE;
bool SetWebAppImage(const GURL& url, const SkBitmap& image);
diff --git a/chrome/browser/webdata/web_apps_table_unittest.cc b/chrome/browser/webdata/web_apps_table_unittest.cc
index 3cd4dfa..f52f853 100644
--- a/chrome/browser/webdata/web_apps_table_unittest.cc
+++ b/chrome/browser/webdata/web_apps_table_unittest.cc
@@ -28,7 +28,7 @@ class WebAppsTableTest : public testing::Test {
table_.reset(new WebAppsTable);
db_.reset(new WebDatabase);
db_->AddTable(table_.get());
- ASSERT_EQ(sql::INIT_OK, db_->Init(file_, std::string()));
+ ASSERT_EQ(sql::INIT_OK, db_->Init(file_));
}
base::FilePath file_;
diff --git a/chrome/browser/webdata/web_data_service_factory.cc b/chrome/browser/webdata/web_data_service_factory.cc
index 1564eca..6597deb 100644
--- a/chrome/browser/webdata/web_data_service_factory.cc
+++ b/chrome/browser/webdata/web_data_service_factory.cc
@@ -53,8 +53,7 @@ WebDataServiceWrapper::WebDataServiceWrapper(Profile* profile) {
base::FilePath path = profile->GetPath();
path = path.Append(kWebDataFilename);
- web_database_ = new WebDatabaseService(
- path, AutofillCountry::ApplicationLocale());
+ web_database_ = new WebDatabaseService(path);
// All tables objects that participate in managing the database must
// be added here.
diff --git a/chrome/browser/webdata/web_data_service_unittest.cc b/chrome/browser/webdata/web_data_service_unittest.cc
index c3c52c4..501adae 100644
--- a/chrome/browser/webdata/web_data_service_unittest.cc
+++ b/chrome/browser/webdata/web_data_service_unittest.cc
@@ -70,7 +70,7 @@ class WebDataServiceTest : public testing::Test {
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
base::FilePath path = temp_dir_.path().AppendASCII("TestWebDB");
- wdbs_ = new WebDatabaseService(path, AutofillCountry::ApplicationLocale());
+ wdbs_ = new WebDatabaseService(path);
wdbs_->AddTable(scoped_ptr<WebDatabaseTable>(new AutofillTable()));
wdbs_->LoadDatabase(WebDatabaseService::InitCallback());
diff --git a/chrome/browser/webdata/web_database.cc b/chrome/browser/webdata/web_database.cc
index 71adced..7464ffe 100644
--- a/chrome/browser/webdata/web_database.cc
+++ b/chrome/browser/webdata/web_database.cc
@@ -69,8 +69,7 @@ sql::Connection* WebDatabase::GetSQLConnection() {
return &db_;
}
-sql::InitStatus WebDatabase::Init(const base::FilePath& db_name,
- const std::string& app_locale) {
+sql::InitStatus WebDatabase::Init(const base::FilePath& db_name) {
// When running in unit tests, there is already a NotificationService object.
// Since only one can exist at a time per thread, check first.
if (!content::NotificationService::current())
@@ -120,15 +119,14 @@ sql::InitStatus WebDatabase::Init(const base::FilePath& db_name,
// If the file on disk is an older database version, bring it up to date.
// If the migration fails we return an error to caller and do not commit
// the migration.
- sql::InitStatus migration_status = MigrateOldVersionsAsNeeded(app_locale);
+ sql::InitStatus migration_status = MigrateOldVersionsAsNeeded();
if (migration_status != sql::INIT_OK)
return migration_status;
return transaction.Commit() ? sql::INIT_OK : sql::INIT_FAILURE;
}
-sql::InitStatus WebDatabase::MigrateOldVersionsAsNeeded(
- const std::string& app_locale) {
+sql::InitStatus WebDatabase::MigrateOldVersionsAsNeeded() {
// Some malware used to lower the version number, causing migration to
// fail. Ensure the version number is at least as high as the compatible
// version number.
@@ -164,8 +162,7 @@ sql::InitStatus WebDatabase::MigrateOldVersionsAsNeeded(
// Any of the tables may set this to true, but by default it is false.
bool update_compatible_version = false;
if (!it->second->MigrateToVersion(next_version,
- app_locale,
- &update_compatible_version)) {
+ &update_compatible_version)) {
return FailedMigrationTo(next_version);
}
diff --git a/chrome/browser/webdata/web_database.h b/chrome/browser/webdata/web_database.h
index e186f34..578452d 100644
--- a/chrome/browser/webdata/web_database.h
+++ b/chrome/browser/webdata/web_database.h
@@ -44,14 +44,11 @@ class WebDatabase {
// Initialize the database given a name. The name defines where the SQLite
// file is. If this returns an error code, no other method should be called.
- // Requires the |app_locale| to be passed as a parameter as the locale can
- // only safely be queried on the UI thread.
//
// Before calling this method, you must call AddTable for any
// WebDatabaseTable objects that are supposed to participate in
// managing the database.
- sql::InitStatus Init(
- const base::FilePath& db_name, const std::string& app_locale);
+ sql::InitStatus Init(const base::FilePath& db_name);
// Transactions management
void BeginTransaction();
@@ -62,9 +59,8 @@ class WebDatabase {
private:
// Used by |Init()| to migration database schema from older versions to
- // current version. Requires the |app_locale| to be passed as a parameter as
- // the locale can only safely be queried on the UI thread.
- sql::InitStatus MigrateOldVersionsAsNeeded(const std::string& app_locale);
+ // current version.
+ sql::InitStatus MigrateOldVersionsAsNeeded();
sql::Connection db_;
sql::MetaTable meta_table_;
diff --git a/chrome/browser/webdata/web_database_migration_unittest.cc b/chrome/browser/webdata/web_database_migration_unittest.cc
index a67210c..063ecfc 100644
--- a/chrome/browser/webdata/web_database_migration_unittest.cc
+++ b/chrome/browser/webdata/web_database_migration_unittest.cc
@@ -190,7 +190,7 @@ class WebDatabaseMigrationTest : public testing::Test {
db.AddTable(&web_intents_table);
// This causes the migration to occur.
- ASSERT_EQ(sql::INIT_OK, db.Init(GetDatabasePath(), std::string()));
+ ASSERT_EQ(sql::INIT_OK, db.Init(GetDatabasePath()));
}
protected:
diff --git a/chrome/browser/webdata/web_database_service.cc b/chrome/browser/webdata/web_database_service.cc
index d34b4bd..d60b977 100644
--- a/chrome/browser/webdata/web_database_service.cc
+++ b/chrome/browser/webdata/web_database_service.cc
@@ -27,8 +27,7 @@ class WebDataServiceBackend
: public base::RefCountedThreadSafe<WebDataServiceBackend,
BrowserThread::DeleteOnDBThread> {
public:
- explicit WebDataServiceBackend(
- const FilePath& path, const std::string app_locale);
+ explicit WebDataServiceBackend(const FilePath& path);
// Must call only before InitDatabaseWithCallback.
void AddTable(scoped_ptr<WebDatabaseTable> table);
@@ -97,22 +96,15 @@ class WebDataServiceBackend
// fails), used to avoid continually trying to reinit if the db init fails.
bool init_complete_;
- // The application locale. The locale is needed for some database migrations,
- // and must be read on the UI thread. It's cached here so that we can pass it
- // to the migration code on the DB thread.
- const std::string app_locale_;
-
DISALLOW_COPY_AND_ASSIGN(WebDataServiceBackend);
};
WebDataServiceBackend::WebDataServiceBackend(
- const FilePath& path,
- const std::string app_locale)
+ const FilePath& path)
: db_path_(path),
request_manager_(new WebDataRequestManager()),
init_status_(sql::INIT_FAILURE),
- init_complete_(false),
- app_locale_(app_locale) {
+ init_complete_(false) {
}
void WebDataServiceBackend::AddTable(scoped_ptr<WebDatabaseTable> table) {
@@ -140,7 +132,7 @@ sql::InitStatus WebDataServiceBackend::LoadDatabaseIfNecessary() {
db_->AddTable(*it);
}
- init_status_ = db_->Init(db_path_, app_locale_);
+ init_status_ = db_->Init(db_path_);
if (init_status_ != sql::INIT_OK) {
LOG(ERROR) << "Cannot initialize the web database: " << init_status_;
db_.reset(NULL);
@@ -198,10 +190,8 @@ void WebDataServiceBackend::Commit() {
////////////////////////////////////////////////////////////////////////////////
WebDatabaseService::WebDatabaseService(
- const base::FilePath& path,
- const std::string app_locale)
- : path_(path),
- app_locale_(app_locale) {
+ const base::FilePath& path)
+ : path_(path) {
// WebDatabaseService should be instantiated on UI thread.
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
// WebDatabaseService requires DB thread if instantiated.
@@ -213,7 +203,7 @@ WebDatabaseService::~WebDatabaseService() {
void WebDatabaseService::AddTable(scoped_ptr<WebDatabaseTable> table) {
if (!wds_backend_) {
- wds_backend_ = new WebDataServiceBackend(path_, app_locale_);
+ wds_backend_ = new WebDataServiceBackend(path_);
}
wds_backend_->AddTable(table.Pass());
}
diff --git a/chrome/browser/webdata/web_database_service.h b/chrome/browser/webdata/web_database_service.h
index d2d70e8..c15d12b 100644
--- a/chrome/browser/webdata/web_database_service.h
+++ b/chrome/browser/webdata/web_database_service.h
@@ -50,10 +50,8 @@ class WebDatabaseService
typedef base::Callback<WebDatabase::State(WebDatabase*)> WriteTask;
typedef base::Callback<void(sql::InitStatus)> InitCallback;
- // Takes the path to the WebDatabase file, and the locale (for migration
- // purposes).
- explicit WebDatabaseService(
- const base::FilePath& path, const std::string app_locale);
+ // Takes the path to the WebDatabase file.
+ explicit WebDatabaseService(const base::FilePath& path);
// Adds |table| as a WebDatabaseTable that will participate in
// managing the database, transferring ownership. All calls to this
@@ -100,11 +98,6 @@ class WebDatabaseService
base::FilePath path_;
- // The application locale. The locale is needed for some database migrations,
- // and must be read on the UI thread. It's cached here so that we can pass it
- // to the migration code on the DB thread.
- std::string app_locale_;
-
// The primary owner is |WebDatabaseService| but is refcounted because
// PostTask on DB thread may outlive us.
scoped_refptr<WebDataServiceBackend> wds_backend_;
diff --git a/chrome/browser/webdata/web_database_table.h b/chrome/browser/webdata/web_database_table.h
index 881d5e7..adef00f 100644
--- a/chrome/browser/webdata/web_database_table.h
+++ b/chrome/browser/webdata/web_database_table.h
@@ -44,14 +44,10 @@ class WebDatabaseTable {
// Migrates this table to |version|. Returns false if there was
// migration work to do and it failed, true otherwise.
//
- // |app_locale| is the locale of the app. Passed as a parameter as
- // |it can only be safely queried on the UI thread.
- //
// Implementations may set |*update_compatible_version| to true if
// the compatible version should be changed to |version|.
// Implementations should otherwise not modify this parameter.
virtual bool MigrateToVersion(int version,
- const std::string& app_locale,
bool* update_compatible_version) = 0;
protected:
diff --git a/chrome/browser/webdata/web_intents_table.cc b/chrome/browser/webdata/web_intents_table.cc
index 0214ac0..a458d6a 100644
--- a/chrome/browser/webdata/web_intents_table.cc
+++ b/chrome/browser/webdata/web_intents_table.cc
@@ -91,7 +91,6 @@ bool WebIntentsTable::IsSyncable() {
}
bool WebIntentsTable::MigrateToVersion(int version,
- const std::string& app_locale,
bool* update_compatible_version) {
if (version == 46) {
*update_compatible_version = true;
diff --git a/chrome/browser/webdata/web_intents_table.h b/chrome/browser/webdata/web_intents_table.h
index 8a8805d..2b09d6b 100644
--- a/chrome/browser/webdata/web_intents_table.h
+++ b/chrome/browser/webdata/web_intents_table.h
@@ -62,7 +62,6 @@ class WebIntentsTable : public WebDatabaseTable {
virtual bool Init(sql::Connection* db, sql::MetaTable* meta_table) OVERRIDE;
virtual bool IsSyncable() OVERRIDE;
virtual bool MigrateToVersion(int version,
- const std::string& app_locale,
bool* update_compatible_version) OVERRIDE;
// Adds "scheme" column to the web_intents and web_intents_defaults tables.
diff --git a/chrome_frame/test/delete_chrome_history_test.cc b/chrome_frame/test/delete_chrome_history_test.cc
index 653a68c..56b449a 100644
--- a/chrome_frame/test/delete_chrome_history_test.cc
+++ b/chrome_frame/test/delete_chrome_history_test.cc
@@ -105,7 +105,7 @@ ACTION_P2(ExpectFormValuesForElementNameMatch, element_name, matcher) {
AutofillTable autofill_table;
WebDatabase web_database;
web_database.AddTable(&autofill_table);
- sql::InitStatus init_status = web_database.Init(profile_path, std::string());
+ sql::InitStatus init_status = web_database.Init(profile_path);
EXPECT_EQ(sql::INIT_OK, init_status);
if (init_status == sql::INIT_OK) {