OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_ |
| 6 #define CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_ |
| 7 |
| 8 #include "chrome/browser/sync/engine/model_safe_worker.h" |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/ref_counted.h" |
| 12 #include "chrome/browser/sync/util/closure.h" |
| 13 |
| 14 class PasswordStore; |
| 15 |
| 16 namespace base { |
| 17 class WaitableEvent; |
| 18 } |
| 19 |
| 20 namespace browser_sync { |
| 21 |
| 22 // A ModelSafeWorker for password models that accepts requests |
| 23 // from the syncapi that need to be fulfilled on the password thread, |
| 24 // which is the DB thread on Linux and Windows. |
| 25 class PasswordModelWorker : public browser_sync::ModelSafeWorker { |
| 26 public: |
| 27 explicit PasswordModelWorker(PasswordStore* password_store); |
| 28 |
| 29 // ModelSafeWorker implementation. Called on syncapi SyncerThread. |
| 30 void DoWorkAndWaitUntilDone(Closure* work); |
| 31 virtual ModelSafeGroup GetModelSafeGroup() { return GROUP_PASSWORD; } |
| 32 virtual bool CurrentThreadIsWorkThread(); |
| 33 |
| 34 private: |
| 35 void CallDoWorkAndSignalTask(Closure* work, base::WaitableEvent* done); |
| 36 |
| 37 scoped_refptr<PasswordStore> password_store_; |
| 38 DISALLOW_COPY_AND_ASSIGN(PasswordModelWorker); |
| 39 }; |
| 40 |
| 41 } // namespace browser_sync |
| 42 |
| 43 #endif // CHROME_BROWSER_SYNC_GLUE_PASSWORD_MODEL_WORKER_H_ |
OLD | NEW |