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

Unified Diff: components/password_manager/core/browser/login_database.cc

Issue 1083293004: Implement the statistics table for the passwords. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address the comments Created 5 years, 8 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: 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;

Powered by Google App Engine
This is Rietveld 408576698