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

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

Issue 2729853005: Stop password migration from the Keychain on Mac. (Closed)
Patch Set: Created 3 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_proxy_mac.h" 5 #include "chrome/browser/password_manager/password_store_proxy_mac.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 void PasswordStoreProxyMac::InitOnBackgroundThread(MigrationStatus status) { 80 void PasswordStoreProxyMac::InitOnBackgroundThread(MigrationStatus status) {
81 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread()); 81 DCHECK(GetBackgroundTaskRunner()->BelongsToCurrentThread());
82 if (!login_metadata_db_->Init()) { 82 if (!login_metadata_db_->Init()) {
83 login_metadata_db_.reset(); 83 login_metadata_db_.reset();
84 LOG(ERROR) << "Could not create/open login database."; 84 LOG(ERROR) << "Could not create/open login database.";
85 } 85 }
86 86
87 if (login_metadata_db_ && (status == MigrationStatus::NOT_STARTED || 87 if (login_metadata_db_ && (status == MigrationStatus::NOT_STARTED ||
88 status == MigrationStatus::FAILED_ONCE || 88 status == MigrationStatus::FAILED_ONCE ||
89 status == MigrationStatus::FAILED_TWICE)) { 89 status == MigrationStatus::FAILED_TWICE)) {
90 // Let's try to migrate the passwords. 90 // Migration isn't possible due to Chrome changing the certificate. Just
91 login_metadata_db_->set_clear_password_values(true); 91 // drop the entries in the DB because they don't have passwords anyway.
92 auto import_status = 92 login_metadata_db_->RemoveLoginsCreatedBetween(base::Time(), base::Time());
93 PasswordStoreMac::ImportFromKeychain(login_metadata_db_.get(), 93 status = MigrationStatus::MIGRATION_STOPPED;
94 keychain_.get());
95 if (import_status == PasswordStoreMac::MIGRATION_OK) {
96 status = MigrationStatus::MIGRATED;
97 } else if (import_status == PasswordStoreMac::MIGRATION_PARTIAL) {
98 status = MigrationStatus::MIGRATED_PARTIALLY;
99 } else {
100 login_metadata_db_.reset();
101 }
102 pending_ui_tasks_.push_back( 94 pending_ui_tasks_.push_back(
103 base::Bind(&PasswordStoreProxyMac::UpdateStatusPref, this, status)); 95 base::Bind(&PasswordStoreProxyMac::UpdateStatusPref, this, status));
104 } else if (login_metadata_db_ && status == MigrationStatus::MIGRATED) { 96 } else if (login_metadata_db_ && status == MigrationStatus::MIGRATED) {
105 // Delete the migrated passwords from the keychain. 97 // Delete the migrated passwords from the keychain.
106 std::vector<std::unique_ptr<autofill::PasswordForm>> forms; 98 std::vector<std::unique_ptr<autofill::PasswordForm>> forms;
107 if (login_metadata_db_->GetAutofillableLogins(&forms)) { 99 if (login_metadata_db_->GetAutofillableLogins(&forms)) {
108 PasswordStoreMac::CleanUpKeychain(keychain_.get(), forms); 100 PasswordStoreMac::CleanUpKeychain(keychain_.get(), forms);
109 status = MigrationStatus::MIGRATED_DELETED; 101 status = MigrationStatus::MIGRATED_DELETED;
110 pending_ui_tasks_.push_back( 102 pending_ui_tasks_.push_back(
111 base::Bind(&PasswordStoreProxyMac::UpdateStatusPref, this, status)); 103 base::Bind(&PasswordStoreProxyMac::UpdateStatusPref, this, status));
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 209
218 std::vector<password_manager::InteractionsStats> 210 std::vector<password_manager::InteractionsStats>
219 PasswordStoreProxyMac::GetAllSiteStatsImpl() { 211 PasswordStoreProxyMac::GetAllSiteStatsImpl() {
220 return GetBackend()->GetAllSiteStatsImpl(); 212 return GetBackend()->GetAllSiteStatsImpl();
221 } 213 }
222 214
223 std::vector<password_manager::InteractionsStats> 215 std::vector<password_manager::InteractionsStats>
224 PasswordStoreProxyMac::GetSiteStatsImpl(const GURL& origin_domain) { 216 PasswordStoreProxyMac::GetSiteStatsImpl(const GURL& origin_domain) {
225 return GetBackend()->GetSiteStatsImpl(origin_domain); 217 return GetBackend()->GetSiteStatsImpl(origin_domain);
226 } 218 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698