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

Side by Side 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, 10 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/password_manager/core/browser/login_database.h" 5 #include "components/password_manager/core/browser/login_database.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 std::string username = sync_statement.ColumnString(0); 447 std::string username = sync_statement.ColumnString(0);
448 if (gaia::AreEmailsSame(sync_username, username)) { 448 if (gaia::AreEmailsSame(sync_username, username)) {
449 syncing_account_saved = true; 449 syncing_account_saved = true;
450 break; 450 break;
451 } 451 }
452 } 452 }
453 } 453 }
454 UMA_HISTOGRAM_ENUMERATION("PasswordManager.SyncingAccountState", 454 UMA_HISTOGRAM_ENUMERATION("PasswordManager.SyncingAccountState",
455 2 * sync_username.empty() + syncing_account_saved, 455 2 * sync_username.empty() + syncing_account_saved,
456 4); 456 4);
457
458 sql::Statement empty_usernames_statement(db_.GetCachedStatement(
459 SQL_FROM_HERE, "SELECT COUNT(*) FROM logins "
460 "WHERE blacklisted_by_user=0 AND username_value=''"));
461 if (empty_usernames_statement.Step()) {
462 int empty_forms = empty_usernames_statement.ColumnInt(0);
463 UMA_HISTOGRAM_COUNTS_100("PasswordManager.EmptyUsernames.CountInDatabase",
464 empty_forms);
465 }
457 } 466 }
458 467
459 PasswordStoreChangeList LoginDatabase::AddLogin(const PasswordForm& form) { 468 PasswordStoreChangeList LoginDatabase::AddLogin(const PasswordForm& form) {
460 PasswordStoreChangeList list; 469 PasswordStoreChangeList list;
461 if (!DoesMatchConstraints(form)) 470 if (!DoesMatchConstraints(form))
462 return list; 471 return list;
463 std::string encrypted_password; 472 std::string encrypted_password;
464 if (EncryptedString(form.password_value, &encrypted_password) != 473 if (EncryptedString(form.password_value, &encrypted_password) !=
465 ENCRYPTION_RESULT_SUCCESS) 474 ENCRYPTION_RESULT_SUCCESS)
466 return list; 475 return list;
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 889
881 bool LoginDatabase::DeleteAndRecreateDatabaseFile() { 890 bool LoginDatabase::DeleteAndRecreateDatabaseFile() {
882 DCHECK(db_.is_open()); 891 DCHECK(db_.is_open());
883 meta_table_.Reset(); 892 meta_table_.Reset();
884 db_.Close(); 893 db_.Close();
885 sql::Connection::Delete(db_path_); 894 sql::Connection::Delete(db_path_);
886 return Init(); 895 return Init();
887 } 896 }
888 897
889 } // namespace password_manager 898 } // namespace password_manager
OLDNEW
« 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