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

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

Issue 1852093002: components/password_manager: scoped_ptr -> unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and revert an accidental .proto change Created 4 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 unified diff | Download patch
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>
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698