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

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

Issue 892443002: Add UMA histograms for tracking empty usernames. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change comment Created 5 years, 11 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
« no previous file with comments | « no previous file | components/password_manager/core/browser/login_database_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4c65080b080dab0fcbc0947e8b477e872fcd4349..31cbb6154bc1dd4f351f6b9fc564136e3c7a7ade 100644
--- a/components/password_manager/core/browser/login_database.cc
+++ b/components/password_manager/core/browser/login_database.cc
@@ -454,6 +454,15 @@ void LoginDatabase::ReportMetrics(const std::string& sync_username,
UMA_HISTOGRAM_ENUMERATION("PasswordManager.SyncingAccountState",
2 * sync_username.empty() + syncing_account_saved,
4);
+
+ sql::Statement empty_usernames_statement(db_.GetCachedStatement(
+ SQL_FROM_HERE, "SELECT COUNT(*) FROM logins "
+ "WHERE blacklisted_by_user=0 AND username_value=''"));
+ if (empty_usernames_statement.Step()) {
+ int empty_forms = empty_usernames_statement.ColumnInt(0);
+ UMA_HISTOGRAM_COUNTS_100("PasswordManager.EmptyUsernames.CountInDatabase",
+ empty_forms);
+ }
}
PasswordStoreChangeList LoginDatabase::AddLogin(const PasswordForm& form) {
« no previous file with comments | « no previous file | components/password_manager/core/browser/login_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698