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

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

Issue 1217273007: [Password Manager] Add UMA statistics for PasswordForm::ssl_valid usage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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 | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
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 d4609ce68c888a91b29c403103ce8529440a0694..f61f810f1b83b84c8b60f98092c43cf989f9fe57 100644
--- a/components/password_manager/core/browser/login_database.cc
+++ b/components/password_manager/core/browser/login_database.cc
@@ -24,6 +24,7 @@
#include "sql/connection.h"
#include "sql/statement.h"
#include "sql/transaction.h"
+#include "url/url_constants.h"
using autofill::PasswordForm;
@@ -527,6 +528,22 @@ void LoginDatabase::ReportMetrics(const std::string& sync_username,
"PasswordManager.EmptyUsernames.WithoutCorrespondingNonempty",
num_entries);
}
+
+ sql::Statement invalid_ssl_cert_statement(db_.GetCachedStatement(
+ SQL_FROM_HERE, "SELECT origin_url, ssl_valid FROM logins;"));
+
+ if (!invalid_ssl_cert_statement.is_valid())
+ return;
+
+ while (invalid_ssl_cert_statement.Step()) {
+ GURL url = GURL(invalid_ssl_cert_statement.ColumnString(0));
+
+ if (url.SchemeIs(url::kHttpsScheme)) {
+ metrics_util::LogUMAHistogramBoolean(
+ "PasswordManager.UserStoredPasswordWithInvalidSSLCert",
+ invalid_ssl_cert_statement.ColumnInt(1) > 0);
Garrett Casto 2015/07/07 22:35:18 Isn't this backwards? That is when ssl_valid is tr
xunlu 2015/07/08 00:02:51 Oops. Done
+ }
+ }
}
PasswordStoreChangeList LoginDatabase::AddLogin(const PasswordForm& form) {
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698