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

Side by Side Diff: components/password_manager/core/browser/login_database.cc

Issue 2133173003: Minor fixes in login_database.* and sql/statement.* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typos Created 4 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 unified diff | Download patch
« no previous file with comments | « components/password_manager/core/browser/login_database.h ('k') | sql/statement.h » ('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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <algorithm> 9 #include <algorithm>
10 #include <limits> 10 #include <limits>
11 #include <map>
11 #include <utility> 12 #include <utility>
12 13
13 #include "base/bind.h" 14 #include "base/bind.h"
14 #include "base/files/file_path.h" 15 #include "base/files/file_path.h"
15 #include "base/logging.h" 16 #include "base/logging.h"
16 #include "base/macros.h" 17 #include "base/macros.h"
17 #include "base/metrics/histogram_macros.h" 18 #include "base/metrics/histogram_macros.h"
18 #include "base/metrics/sparse_histogram.h" 19 #include "base/metrics/sparse_histogram.h"
19 #include "base/pickle.h" 20 #include "base/pickle.h"
20 #include "base/stl_util.h" 21 #include "base/stl_util.h"
(...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 bool LoginDatabase::DisableAutoSignInForAllLogins() { 1051 bool LoginDatabase::DisableAutoSignInForAllLogins() {
1051 sql::Statement s(db_.GetCachedStatement( 1052 sql::Statement s(db_.GetCachedStatement(
1052 SQL_FROM_HERE, "UPDATE logins SET skip_zero_click = 1;")); 1053 SQL_FROM_HERE, "UPDATE logins SET skip_zero_click = 1;"));
1053 1054
1054 return s.Run(); 1055 return s.Run();
1055 } 1056 }
1056 1057
1057 // static 1058 // static
1058 LoginDatabase::EncryptionResult LoginDatabase::InitPasswordFormFromStatement( 1059 LoginDatabase::EncryptionResult LoginDatabase::InitPasswordFormFromStatement(
1059 PasswordForm* form, 1060 PasswordForm* form,
1060 sql::Statement& s) { 1061 const sql::Statement& s) {
1061 std::string encrypted_password; 1062 std::string encrypted_password;
1062 s.ColumnBlobAsString(COLUMN_PASSWORD_VALUE, &encrypted_password); 1063 s.ColumnBlobAsString(COLUMN_PASSWORD_VALUE, &encrypted_password);
1063 base::string16 decrypted_password; 1064 base::string16 decrypted_password;
1064 EncryptionResult encryption_result = 1065 EncryptionResult encryption_result =
1065 DecryptedString(encrypted_password, &decrypted_password); 1066 DecryptedString(encrypted_password, &decrypted_password);
1066 if (encryption_result != ENCRYPTION_RESULT_SUCCESS) { 1067 if (encryption_result != ENCRYPTION_RESULT_SUCCESS) {
1067 VLOG(0) << "Password decryption failed, encryption_result is " 1068 VLOG(0) << "Password decryption failed, encryption_result is "
1068 << encryption_result; 1069 << encryption_result;
1069 return encryption_result; 1070 return encryption_result;
1070 } 1071 }
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1351 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering", 1352 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering",
1352 psl_domain_match_metric, PSL_DOMAIN_MATCH_COUNT); 1353 psl_domain_match_metric, PSL_DOMAIN_MATCH_COUNT);
1353 } 1354 }
1354 1355
1355 if (!statement->Succeeded()) 1356 if (!statement->Succeeded())
1356 return false; 1357 return false;
1357 return true; 1358 return true;
1358 } 1359 }
1359 1360
1360 } // namespace password_manager 1361 } // namespace password_manager
OLDNEW
« no previous file with comments | « components/password_manager/core/browser/login_database.h ('k') | sql/statement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698