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