| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_ |
| 7 | 7 |
| 8 #include "sync/internal_api/public/engine/model_safe_worker.h" | 8 #include "sync/internal_api/public/engine/model_safe_worker.h" |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 // A syncer::ModelSafeWorker for password models that accepts requests | 25 // A syncer::ModelSafeWorker for password models that accepts requests |
| 26 // from the syncapi that need to be fulfilled on the password thread, | 26 // from the syncapi that need to be fulfilled on the password thread, |
| 27 // which is the DB thread on Linux and Windows. | 27 // which is the DB thread on Linux and Windows. |
| 28 class PasswordModelWorker : public syncer::ModelSafeWorker { | 28 class PasswordModelWorker : public syncer::ModelSafeWorker { |
| 29 public: | 29 public: |
| 30 PasswordModelWorker( | 30 PasswordModelWorker( |
| 31 const scoped_refptr<password_manager::PasswordStore>& password_store, | 31 const scoped_refptr<password_manager::PasswordStore>& password_store, |
| 32 syncer::WorkerLoopDestructionObserver* observer); | 32 syncer::WorkerLoopDestructionObserver* observer); |
| 33 | 33 |
| 34 // syncer::ModelSafeWorker implementation. Called on syncapi SyncerThread. | 34 // syncer::ModelSafeWorker implementation. Called on syncapi SyncerThread. |
| 35 virtual void RegisterForLoopDestruction() OVERRIDE; | 35 virtual void RegisterForLoopDestruction() override; |
| 36 virtual syncer::ModelSafeGroup GetModelSafeGroup() OVERRIDE; | 36 virtual syncer::ModelSafeGroup GetModelSafeGroup() override; |
| 37 virtual void RequestStop() OVERRIDE; | 37 virtual void RequestStop() override; |
| 38 | 38 |
| 39 protected: | 39 protected: |
| 40 virtual syncer::SyncerError DoWorkAndWaitUntilDoneImpl( | 40 virtual syncer::SyncerError DoWorkAndWaitUntilDoneImpl( |
| 41 const syncer::WorkCallback& work) OVERRIDE; | 41 const syncer::WorkCallback& work) override; |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 virtual ~PasswordModelWorker(); | 44 virtual ~PasswordModelWorker(); |
| 45 | 45 |
| 46 void CallDoWorkAndSignalTask( | 46 void CallDoWorkAndSignalTask( |
| 47 const syncer::WorkCallback& work, | 47 const syncer::WorkCallback& work, |
| 48 base::WaitableEvent* done, | 48 base::WaitableEvent* done, |
| 49 syncer::SyncerError* error); | 49 syncer::SyncerError* error); |
| 50 | 50 |
| 51 // Called on password thread to add PasswordModelWorker as destruction | 51 // Called on password thread to add PasswordModelWorker as destruction |
| 52 // observer. | 52 // observer. |
| 53 void RegisterForPasswordLoopDestruction(); | 53 void RegisterForPasswordLoopDestruction(); |
| 54 | 54 |
| 55 // |password_store_| is used on password thread but released on UI thread. | 55 // |password_store_| is used on password thread but released on UI thread. |
| 56 // Protected by |password_store_lock_|. | 56 // Protected by |password_store_lock_|. |
| 57 base::Lock password_store_lock_; | 57 base::Lock password_store_lock_; |
| 58 scoped_refptr<password_manager::PasswordStore> password_store_; | 58 scoped_refptr<password_manager::PasswordStore> password_store_; |
| 59 DISALLOW_COPY_AND_ASSIGN(PasswordModelWorker); | 59 DISALLOW_COPY_AND_ASSIGN(PasswordModelWorker); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 } // namespace browser_sync | 62 } // namespace browser_sync |
| 63 | 63 |
| 64 #endif // CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_ | 64 #endif // CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_ |
| OLD | NEW |