OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #ifndef COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_MODEL_WORKER_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_MODEL_WORKER_H_ |
6 #define COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_MODEL_WORKER_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_MODEL_WORKER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "components/sync/engine/model_safe_worker.h" | 10 #include "components/sync/engine/model_safe_worker.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 class PasswordModelWorker : public syncer::ModelSafeWorker { | 21 class PasswordModelWorker : public syncer::ModelSafeWorker { |
22 public: | 22 public: |
23 PasswordModelWorker( | 23 PasswordModelWorker( |
24 const scoped_refptr<password_manager::PasswordStore>& password_store); | 24 const scoped_refptr<password_manager::PasswordStore>& password_store); |
25 | 25 |
26 // syncer::ModelSafeWorker implementation. | 26 // syncer::ModelSafeWorker implementation. |
27 syncer::ModelSafeGroup GetModelSafeGroup() override; | 27 syncer::ModelSafeGroup GetModelSafeGroup() override; |
28 bool IsOnModelThread() override; | 28 bool IsOnModelThread() override; |
29 void RequestStop() override; | 29 void RequestStop() override; |
30 | 30 |
| 31 protected: |
| 32 syncer::SyncerError DoWorkAndWaitUntilDoneImpl( |
| 33 const syncer::WorkCallback& work) override; |
| 34 |
31 private: | 35 private: |
32 ~PasswordModelWorker() override; | 36 ~PasswordModelWorker() override; |
33 | 37 |
34 void ScheduleWork(base::OnceClosure work) override; | |
35 | |
36 // |password_store_| is used on password thread but released on UI thread. | 38 // |password_store_| is used on password thread but released on UI thread. |
37 // Protected by |password_store_lock_|. | 39 // Protected by |password_store_lock_|. |
38 base::Lock password_store_lock_; | 40 base::Lock password_store_lock_; |
39 scoped_refptr<password_manager::PasswordStore> password_store_; | 41 scoped_refptr<password_manager::PasswordStore> password_store_; |
40 DISALLOW_COPY_AND_ASSIGN(PasswordModelWorker); | 42 DISALLOW_COPY_AND_ASSIGN(PasswordModelWorker); |
41 }; | 43 }; |
42 | 44 |
43 } // namespace browser_sync | 45 } // namespace browser_sync |
44 | 46 |
45 #endif // COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_MODEL_WORKER_H_ | 47 #endif // COMPONENTS_PASSWORD_MANAGER_SYNC_BROWSER_PASSWORD_MODEL_WORKER_H_ |
OLD | NEW |