Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_default.h" | 5 #include "chrome/browser/password_manager/password_store_default.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 DCHECK(web_data_service); | 111 DCHECK(web_data_service); |
| 112 MigrateIfNecessary(); | 112 MigrateIfNecessary(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 PasswordStoreDefault::~PasswordStoreDefault() { | 115 PasswordStoreDefault::~PasswordStoreDefault() { |
| 116 // MigrateHelper should always be NULL as Shutdown should be invoked before | 116 // MigrateHelper should always be NULL as Shutdown should be invoked before |
| 117 // the destructor. | 117 // the destructor. |
| 118 DCHECK(!migrate_helper_.get()); | 118 DCHECK(!migrate_helper_.get()); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void PasswordStoreDefault::Shutdown() { | 121 void PasswordStoreDefault::ShutdownOnUIThread() { |
| 122 migrate_helper_.reset(); | 122 migrate_helper_.reset(); |
|
Mike Mammarella
2012/03/10 05:11:52
Should there be a DCHECK(BrowserThread::CurrentlyO
Elliot Glaysher
2012/03/12 19:59:40
I've added this, but just temporarily forever.
Wh
| |
| 123 profile_ = NULL; | |
| 123 } | 124 } |
| 124 | 125 |
| 125 void PasswordStoreDefault::ReportMetricsImpl() { | 126 void PasswordStoreDefault::ReportMetricsImpl() { |
| 126 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); | 127 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
| 127 login_db_->ReportMetrics(); | 128 login_db_->ReportMetrics(); |
| 128 } | 129 } |
| 129 | 130 |
| 130 void PasswordStoreDefault::AddLoginImpl(const PasswordForm& form) { | 131 void PasswordStoreDefault::AddLoginImpl(const PasswordForm& form) { |
| 131 if (login_db_->AddLogin(form)) { | 132 if (login_db_->AddLogin(form)) { |
| 132 PasswordStoreChangeList changes; | 133 PasswordStoreChangeList changes; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 211 } | 212 } |
| 212 | 213 |
| 213 void PasswordStoreDefault::MigrateIfNecessary() { | 214 void PasswordStoreDefault::MigrateIfNecessary() { |
| 214 PrefService* prefs = profile_->GetPrefs(); | 215 PrefService* prefs = profile_->GetPrefs(); |
| 215 if (prefs->FindPreference(prefs::kLoginDatabaseMigrated)) | 216 if (prefs->FindPreference(prefs::kLoginDatabaseMigrated)) |
| 216 return; | 217 return; |
| 217 DCHECK(!migrate_helper_.get()); | 218 DCHECK(!migrate_helper_.get()); |
| 218 migrate_helper_.reset(new MigrateHelper(profile_, web_data_service_, this)); | 219 migrate_helper_.reset(new MigrateHelper(profile_, web_data_service_, this)); |
| 219 migrate_helper_->Init(); | 220 migrate_helper_->Init(); |
| 220 } | 221 } |
| OLD | NEW |