Chromium Code Reviews| Index: chrome/browser/password_manager/password_store_proxy_mac.h |
| diff --git a/chrome/browser/password_manager/password_store_proxy_mac.h b/chrome/browser/password_manager/password_store_proxy_mac.h |
| index 67029cf3ceec3be5219ef9f0993db80496d74d6f..fffbc8ef805774f6d1fa647df36aa4f14de23bda 100644 |
| --- a/chrome/browser/password_manager/password_store_proxy_mac.h |
| +++ b/chrome/browser/password_manager/password_store_proxy_mac.h |
| @@ -5,8 +5,12 @@ |
| #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_PROXY_MAC_H_ |
| #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_STORE_PROXY_MAC_H_ |
| +#include <deque> |
| + |
| +#include "base/prefs/pref_member.h" |
| #include "base/threading/thread.h" |
| #include "components/password_manager/core/browser/password_store.h" |
| +#include "components/password_manager/core/common/password_manager_pref_names.h" |
| namespace crypto { |
| class AppleKeychain; |
| @@ -28,7 +32,8 @@ class PasswordStoreProxyMac : public password_manager::PasswordStore { |
| PasswordStoreProxyMac( |
| scoped_refptr<base::SingleThreadTaskRunner> main_thread_runner, |
| scoped_ptr<crypto::AppleKeychain> keychain, |
| - scoped_ptr<password_manager::LoginDatabase> login_db); |
| + scoped_ptr<password_manager::LoginDatabase> login_db, |
| + PrefService* prefs); |
| bool Init(const syncer::SyncableService::StartSyncFlare& flare) override; |
| void Shutdown() override; |
| @@ -47,7 +52,13 @@ class PasswordStoreProxyMac : public password_manager::PasswordStore { |
| password_manager::PasswordStore* GetBackend() const; |
| // Opens LoginDatabase on the background |thread_|. |
| - void InitOnBackgroundThread(); |
| + void InitOnBackgroundThread(password_manager::MigrationStatus status); |
| + |
| + // Writes status to the prefs. |
| + void UpdateStatusPref(password_manager::MigrationStatus status); |
| + |
| + // Executes |pending_ui_tasks_| on the UI thread. |
| + void FlushPendingTasks(); |
| // PasswordStore: |
| void ReportMetricsImpl(const std::string& sync_username, |
| @@ -82,11 +93,20 @@ class PasswordStoreProxyMac : public password_manager::PasswordStore { |
| // The login metadata SQL database. If opening the DB on |thread_| fails, |
| // |login_metadata_db_| will be reset to NULL for the lifetime of |this|. |
| + // The ownership maybe transferred to |password_store_simple_|. |
|
vabr (Chromium)
2015/07/06 09:50:19
nit: maybe -> may be
(otherwise the verb is missin
vasilii
2015/07/06 13:57:57
Done.
|
| scoped_ptr<password_manager::LoginDatabase> login_metadata_db_; |
| // Thread that the synchronous methods are run on. |
| scoped_ptr<base::Thread> thread_; |
| + // Current migration status for the profile. |
| + IntegerPrefMember migration_status_; |
| + |
| + // List of task filled by InitOnBackgroundThread. They can't be just posted to |
|
vabr (Chromium)
2015/07/06 09:50:19
After clarifying the concurrency concerns with you
vabr (Chromium)
2015/07/06 09:50:19
nit: task -> tasks
vasilii
2015/07/06 13:57:57
Done.
vasilii
2015/07/06 13:57:58
Done.
|
| + // the UI thread because the message loop can shutdown before executing them. |
|
vabr (Chromium)
2015/07/06 09:50:19
nit: shutdown -> shut down
(the verb not the noun)
vasilii
2015/07/06 13:57:58
Done.
|
| + // If this is the case then Shutdown() flushes the tasks. |
| + std::deque<base::Closure> pending_ui_tasks_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(PasswordStoreProxyMac); |
| }; |