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

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

Issue 1087233002: Report the number of empty usernames without a nonempty pair. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed 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
« 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 ab8d18f5a08b279dfd95b4a08286d4bc69219b30..f59f8c6d17a1cdc1797354bfd64b8a2792b15b55 100644
--- a/components/password_manager/core/browser/login_database.cc
+++ b/components/password_manager/core/browser/login_database.cc
@@ -504,6 +504,19 @@ void LoginDatabase::ReportMetrics(const std::string& sync_username,
UMA_HISTOGRAM_COUNTS_100("PasswordManager.EmptyUsernames.CountInDatabase",
empty_forms);
}
+
+ sql::Statement standalone_empty_usernames_statement(db_.GetCachedStatement(
+ SQL_FROM_HERE, "SELECT COUNT(*) FROM logins a "
+ "WHERE a.blacklisted_by_user=0 AND a.username_value='' "
+ "AND NOT EXISTS (SELECT * FROM logins b "
+ "WHERE b.blacklisted_by_user=0 AND b.username_value!='' "
+ "AND a.signon_realm = b.signon_realm)"));
+ if (standalone_empty_usernames_statement.Step()) {
+ int num_entries = standalone_empty_usernames_statement.ColumnInt(0);
+ UMA_HISTOGRAM_COUNTS_100(
+ "PasswordManager.EmptyUsernames.WithoutCorrespondingNonempty",
+ num_entries);
+ }
}
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