| OLD | NEW |
| 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> |
| (...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 | 1311 |
| 1312 // static | 1312 // static |
| 1313 bool LoginDatabase::StatementToForms( | 1313 bool LoginDatabase::StatementToForms( |
| 1314 sql::Statement* statement, | 1314 sql::Statement* statement, |
| 1315 const autofill::PasswordForm* matched_form, | 1315 const autofill::PasswordForm* matched_form, |
| 1316 ScopedVector<autofill::PasswordForm>* forms) { | 1316 ScopedVector<autofill::PasswordForm>* forms) { |
| 1317 PSLDomainMatchMetric psl_domain_match_metric = PSL_DOMAIN_MATCH_NONE; | 1317 PSLDomainMatchMetric psl_domain_match_metric = PSL_DOMAIN_MATCH_NONE; |
| 1318 | 1318 |
| 1319 forms->clear(); | 1319 forms->clear(); |
| 1320 while (statement->Step()) { | 1320 while (statement->Step()) { |
| 1321 scoped_ptr<PasswordForm> new_form(new PasswordForm()); | 1321 std::unique_ptr<PasswordForm> new_form(new PasswordForm()); |
| 1322 EncryptionResult result = | 1322 EncryptionResult result = |
| 1323 InitPasswordFormFromStatement(new_form.get(), *statement); | 1323 InitPasswordFormFromStatement(new_form.get(), *statement); |
| 1324 if (result == ENCRYPTION_RESULT_SERVICE_FAILURE) | 1324 if (result == ENCRYPTION_RESULT_SERVICE_FAILURE) |
| 1325 return false; | 1325 return false; |
| 1326 if (result == ENCRYPTION_RESULT_ITEM_FAILURE) | 1326 if (result == ENCRYPTION_RESULT_ITEM_FAILURE) |
| 1327 continue; | 1327 continue; |
| 1328 DCHECK_EQ(ENCRYPTION_RESULT_SUCCESS, result); | 1328 DCHECK_EQ(ENCRYPTION_RESULT_SUCCESS, result); |
| 1329 if (matched_form && matched_form->signon_realm != new_form->signon_realm) { | 1329 if (matched_form && matched_form->signon_realm != new_form->signon_realm) { |
| 1330 if (new_form->scheme != PasswordForm::SCHEME_HTML) | 1330 if (new_form->scheme != PasswordForm::SCHEME_HTML) |
| 1331 continue; // Ignore non-HTML matches. | 1331 continue; // Ignore non-HTML matches. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1348 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering", | 1348 UMA_HISTOGRAM_ENUMERATION("PasswordManager.PslDomainMatchTriggering", |
| 1349 psl_domain_match_metric, PSL_DOMAIN_MATCH_COUNT); | 1349 psl_domain_match_metric, PSL_DOMAIN_MATCH_COUNT); |
| 1350 } | 1350 } |
| 1351 | 1351 |
| 1352 if (!statement->Succeeded()) | 1352 if (!statement->Succeeded()) |
| 1353 return false; | 1353 return false; |
| 1354 return true; | 1354 return true; |
| 1355 } | 1355 } |
| 1356 | 1356 |
| 1357 } // namespace password_manager | 1357 } // namespace password_manager |
| OLD | NEW |