| OLD | NEW |
| 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 28 matching lines...) Expand all Loading... |
| 39 const syncer::SyncableService::StartSyncFlare& flare) { | 39 const syncer::SyncableService::StartSyncFlare& flare) { |
| 40 // Set up a background thread. | 40 // Set up a background thread. |
| 41 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 41 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 42 thread_.reset(new base::Thread("Chrome_PasswordStore_Thread")); | 42 thread_.reset(new base::Thread("Chrome_PasswordStore_Thread")); |
| 43 | 43 |
| 44 if (!thread_->Start()) { | 44 if (!thread_->Start()) { |
| 45 thread_.reset(); | 45 thread_.reset(); |
| 46 return false; | 46 return false; |
| 47 } | 47 } |
| 48 | 48 |
| 49 if (!password_manager::PasswordStore::Init(flare)) | 49 if (!ScheduleTask(base::Bind( |
| 50 &PasswordStoreProxyMac::InitOnBackgroundThread, this, |
| 51 static_cast<MigrationStatus>(migration_status_.GetValue())))) |
| 50 return false; | 52 return false; |
| 51 | 53 |
| 52 return ScheduleTask( | 54 return password_manager::PasswordStore::Init(flare); |
| 53 base::Bind(&PasswordStoreProxyMac::InitOnBackgroundThread, this, | |
| 54 static_cast<MigrationStatus>(migration_status_.GetValue()))); | |
| 55 } | 55 } |
| 56 | 56 |
| 57 void PasswordStoreProxyMac::ShutdownOnUIThread() { | 57 void PasswordStoreProxyMac::ShutdownOnUIThread() { |
| 58 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 58 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 59 PasswordStore::ShutdownOnUIThread(); | 59 PasswordStore::ShutdownOnUIThread(); |
| 60 thread_->Stop(); | 60 thread_->Stop(); |
| 61 | 61 |
| 62 // Execute the task which are still pending. | 62 // Execute the task which are still pending. |
| 63 FlushPendingTasks(); | 63 FlushPendingTasks(); |
| 64 | 64 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 209 |
| 210 std::vector<password_manager::InteractionsStats> | 210 std::vector<password_manager::InteractionsStats> |
| 211 PasswordStoreProxyMac::GetAllSiteStatsImpl() { | 211 PasswordStoreProxyMac::GetAllSiteStatsImpl() { |
| 212 return GetBackend()->GetAllSiteStatsImpl(); | 212 return GetBackend()->GetAllSiteStatsImpl(); |
| 213 } | 213 } |
| 214 | 214 |
| 215 std::vector<password_manager::InteractionsStats> | 215 std::vector<password_manager::InteractionsStats> |
| 216 PasswordStoreProxyMac::GetSiteStatsImpl(const GURL& origin_domain) { | 216 PasswordStoreProxyMac::GetSiteStatsImpl(const GURL& origin_domain) { |
| 217 return GetBackend()->GetSiteStatsImpl(origin_domain); | 217 return GetBackend()->GetSiteStatsImpl(origin_domain); |
| 218 } | 218 } |
| OLD | NEW |