Index: components/password_manager/core/browser/login_database.cc |
diff --git a/components/password_manager/core/browser/login_database.cc b/components/password_manager/core/browser/login_database.cc |
index f59f8c6d17a1cdc1797354bfd64b8a2792b15b55..91c71d06e1231f2cc7dd013f0e10c31c311d36bf 100644 |
--- a/components/password_manager/core/browser/login_database.cc |
+++ b/components/password_manager/core/browser/login_database.cc |
@@ -29,7 +29,7 @@ using autofill::PasswordForm; |
namespace password_manager { |
-const int kCurrentVersionNumber = 12; |
+const int kCurrentVersionNumber = 13; |
static const int kCompatibleVersionNumber = 1; |
Pickle SerializeVector(const std::vector<base::string16>& vec) { |
@@ -233,7 +233,13 @@ bool LoginDatabase::Init() { |
// Initialize the tables. |
if (!InitLoginsTable()) { |
- LOG(WARNING) << "Unable to initialize the password store database."; |
+ LOG(WARNING) << "Unable to initialize the logins table."; |
+ db_.Close(); |
+ return false; |
+ } |
+ |
+ if (!stats_table_.Init(&db_)) { |
+ LOG(WARNING) << "Unable to initialize the stats table."; |
db_.Close(); |
return false; |
} |
@@ -374,6 +380,9 @@ bool LoginDatabase::MigrateOldVersionsAsNeeded() { |
"generation_upload_status INTEGER")) |
return false; |
meta_table_.SetVersionNumber(12); |
+ case 12: |
+ // The stats table was added. Nothing to do really. |
+ meta_table_.SetVersionNumber(13); |
case kCurrentVersionNumber: |
// Already up to date |
return true; |