| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "sync/internal_api/public/engine/model_safe_worker.h" | 9 #include "sync/internal_api/public/engine/model_safe_worker.h" |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/callback_forward.h" | 12 #include "base/callback_forward.h" |
| 13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 | 15 |
| 16 class PasswordStore; | 16 class PasswordStore; |
| 17 | 17 |
| 18 namespace base { | 18 namespace base { |
| 19 class WaitableEvent; | 19 class WaitableEvent; |
| 20 } | 20 } |
| 21 | 21 |
| 22 namespace browser_sync { | 22 namespace browser_sync { |
| 23 | 23 |
| 24 // A csync::ModelSafeWorker for password models that accepts requests | 24 // A syncer::ModelSafeWorker for password models that accepts requests |
| 25 // from the syncapi that need to be fulfilled on the password thread, | 25 // from the syncapi that need to be fulfilled on the password thread, |
| 26 // which is the DB thread on Linux and Windows. | 26 // which is the DB thread on Linux and Windows. |
| 27 class PasswordModelWorker : public csync::ModelSafeWorker { | 27 class PasswordModelWorker : public syncer::ModelSafeWorker { |
| 28 public: | 28 public: |
| 29 explicit PasswordModelWorker( | 29 explicit PasswordModelWorker( |
| 30 const scoped_refptr<PasswordStore>& password_store); | 30 const scoped_refptr<PasswordStore>& password_store); |
| 31 | 31 |
| 32 // csync::ModelSafeWorker implementation. Called on syncapi SyncerThread. | 32 // syncer::ModelSafeWorker implementation. Called on syncapi SyncerThread. |
| 33 virtual csync::SyncerError DoWorkAndWaitUntilDone( | 33 virtual syncer::SyncerError DoWorkAndWaitUntilDone( |
| 34 const csync::WorkCallback& work) OVERRIDE; | 34 const syncer::WorkCallback& work) OVERRIDE; |
| 35 virtual csync::ModelSafeGroup GetModelSafeGroup() OVERRIDE; | 35 virtual syncer::ModelSafeGroup GetModelSafeGroup() OVERRIDE; |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 virtual ~PasswordModelWorker(); | 38 virtual ~PasswordModelWorker(); |
| 39 | 39 |
| 40 void CallDoWorkAndSignalTask( | 40 void CallDoWorkAndSignalTask( |
| 41 const csync::WorkCallback& work, | 41 const syncer::WorkCallback& work, |
| 42 base::WaitableEvent* done, | 42 base::WaitableEvent* done, |
| 43 csync::SyncerError* error); | 43 syncer::SyncerError* error); |
| 44 | 44 |
| 45 scoped_refptr<PasswordStore> password_store_; | 45 scoped_refptr<PasswordStore> password_store_; |
| 46 DISALLOW_COPY_AND_ASSIGN(PasswordModelWorker); | 46 DISALLOW_COPY_AND_ASSIGN(PasswordModelWorker); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 } // namespace browser_sync | 49 } // namespace browser_sync |
| 50 | 50 |
| 51 #endif // CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_ | 51 #endif // CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_ |
| OLD | NEW |