| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/password_manager/password_store_mac.h" | 5 #include "chrome/browser/password_manager/password_store_mac.h" |
| 6 | 6 |
| 7 #include <CoreServices/CoreServices.h> | 7 #include <CoreServices/CoreServices.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 merged_forms->push_back(std::move(form)); | 539 merged_forms->push_back(std::move(form)); |
| 540 } else { | 540 } else { |
| 541 unused_database_forms.push_back(std::move(form)); | 541 unused_database_forms.push_back(std::move(form)); |
| 542 } | 542 } |
| 543 }); | 543 }); |
| 544 database_forms->swap(unused_database_forms); | 544 database_forms->swap(unused_database_forms); |
| 545 | 545 |
| 546 // Clear out all the Keychain entries we used. | 546 // Clear out all the Keychain entries we used. |
| 547 ScopedVector<autofill::PasswordForm> unused_keychain_forms; | 547 ScopedVector<autofill::PasswordForm> unused_keychain_forms; |
| 548 unused_keychain_forms.reserve(keychain_forms->size()); | 548 unused_keychain_forms.reserve(keychain_forms->size()); |
| 549 for (auto& keychain_form : *keychain_forms) { | 549 for (auto*& keychain_form : *keychain_forms) { |
| 550 if (!ContainsKey(used_keychain_forms, keychain_form)) { | 550 if (!ContainsKey(used_keychain_forms, keychain_form)) { |
| 551 unused_keychain_forms.push_back(keychain_form); | 551 unused_keychain_forms.push_back(keychain_form); |
| 552 keychain_form = nullptr; | 552 keychain_form = nullptr; |
| 553 } | 553 } |
| 554 } | 554 } |
| 555 keychain_forms->swap(unused_keychain_forms); | 555 keychain_forms->swap(unused_keychain_forms); |
| 556 } | 556 } |
| 557 | 557 |
| 558 std::vector<ItemFormPair> ExtractAllKeychainItemAttributesIntoPasswordForms( | 558 std::vector<ItemFormPair> ExtractAllKeychainItemAttributesIntoPasswordForms( |
| 559 std::vector<SecKeychainItemRef>* keychain_items, | 559 std::vector<SecKeychainItemRef>* keychain_items, |
| (...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1397 ScopedVector<PasswordForm> forms_with_keychain_entry; | 1397 ScopedVector<PasswordForm> forms_with_keychain_entry; |
| 1398 internal_keychain_helpers::GetPasswordsForForms(*keychain_, &database_forms, | 1398 internal_keychain_helpers::GetPasswordsForForms(*keychain_, &database_forms, |
| 1399 &forms_with_keychain_entry); | 1399 &forms_with_keychain_entry); |
| 1400 | 1400 |
| 1401 // Clean up any orphaned database entries. | 1401 // Clean up any orphaned database entries. |
| 1402 RemoveDatabaseForms(&database_forms); | 1402 RemoveDatabaseForms(&database_forms); |
| 1403 | 1403 |
| 1404 // Move the orphaned DB forms to the output parameter. | 1404 // Move the orphaned DB forms to the output parameter. |
| 1405 AppendSecondToFirst(orphaned_forms, &database_forms); | 1405 AppendSecondToFirst(orphaned_forms, &database_forms); |
| 1406 } | 1406 } |
| OLD | NEW |