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

Side by Side Diff: chrome/browser/password_manager/password_store_mac.cc

Issue 1723583004: CREDENTIAL: Convert federations from URLs to origins throughout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iOS2 Created 4 years, 9 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 (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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 // We moved the ownership of every form out of |forms|. For performance 236 // We moved the ownership of every form out of |forms|. For performance
237 // reasons, we can just weak_clear it, instead of nullptr-ing the respective 237 // reasons, we can just weak_clear it, instead of nullptr-ing the respective
238 // elements and letting the vector's destructor to go through the list once 238 // elements and letting the vector's destructor to go through the list once
239 // more. This was tested on a benchmark, and seemed to make a difference on 239 // more. This was tested on a benchmark, and seemed to make a difference on
240 // Mac. 240 // Mac.
241 forms->weak_clear(); 241 forms->weak_clear();
242 } 242 }
243 243
244 // True if the form has no password to be stored in Keychain. 244 // True if the form has no password to be stored in Keychain.
245 bool IsLoginDatabaseOnlyForm(const autofill::PasswordForm& form) { 245 bool IsLoginDatabaseOnlyForm(const autofill::PasswordForm& form) {
246 return form.blacklisted_by_user || !form.federation_url.is_empty() || 246 return form.blacklisted_by_user || !form.federation_origin.unique() ||
247 form.scheme == autofill::PasswordForm::SCHEME_USERNAME_ONLY; 247 form.scheme == autofill::PasswordForm::SCHEME_USERNAME_ONLY;
248 } 248 }
249 249
250 } // namespace 250 } // namespace
251 251
252 #pragma mark - 252 #pragma mark -
253 253
254 // TODO(stuartmorgan): Convert most of this to private helpers in 254 // TODO(stuartmorgan): Convert most of this to private helpers in
255 // MacKeychainPasswordFormAdapter once it has sufficient higher-level public 255 // MacKeychainPasswordFormAdapter once it has sufficient higher-level public
256 // methods to provide test coverage. 256 // methods to provide test coverage.
(...skipping 1110 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 ScopedVector<PasswordForm> forms_with_keychain_entry; 1367 ScopedVector<PasswordForm> forms_with_keychain_entry;
1368 internal_keychain_helpers::GetPasswordsForForms(*keychain_, &database_forms, 1368 internal_keychain_helpers::GetPasswordsForForms(*keychain_, &database_forms,
1369 &forms_with_keychain_entry); 1369 &forms_with_keychain_entry);
1370 1370
1371 // Clean up any orphaned database entries. 1371 // Clean up any orphaned database entries.
1372 RemoveDatabaseForms(&database_forms); 1372 RemoveDatabaseForms(&database_forms);
1373 1373
1374 // Move the orphaned DB forms to the output parameter. 1374 // Move the orphaned DB forms to the output parameter.
1375 AppendSecondToFirst(orphaned_forms, &database_forms); 1375 AppendSecondToFirst(orphaned_forms, &database_forms);
1376 } 1376 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698