OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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_UI_MODEL_WORKER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_UI_MODEL_WORKER_H_ |
6 #define CHROME_BROWSER_SYNC_GLUE_UI_MODEL_WORKER_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_UI_MODEL_WORKER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/condition_variable.h" | 10 #include "base/condition_variable.h" |
11 #include "base/lock.h" | 11 #include "base/lock.h" |
12 #include "base/task.h" | 12 #include "base/task.h" |
13 #include "base/waitable_event.h" | |
14 #include "chrome/browser/sync/engine/syncapi.h" | 13 #include "chrome/browser/sync/engine/syncapi.h" |
15 #include "chrome/browser/sync/engine/model_safe_worker.h" | 14 #include "chrome/browser/sync/engine/model_safe_worker.h" |
16 | 15 |
| 16 namespace base { |
| 17 class WaitableEvent; |
| 18 } |
| 19 |
17 class MessageLoop; | 20 class MessageLoop; |
18 | 21 |
19 namespace browser_sync { | 22 namespace browser_sync { |
20 | 23 |
21 // A ModelSafeWorker for UI models (e.g. bookmarks) that accepts work requests | 24 // A ModelSafeWorker for UI models (e.g. bookmarks) that accepts work requests |
22 // from the syncapi that need to be fulfilled from the MessageLoop home to the | 25 // from the syncapi that need to be fulfilled from the MessageLoop home to the |
23 // native model. | 26 // native model. |
24 // | 27 // |
25 // Lifetime note: Instances of this class will generally be owned by the | 28 // Lifetime note: Instances of this class will generally be owned by the |
26 // SyncerThread. When the SyncerThread _object_ is destroyed, the | 29 // SyncerThread. When the SyncerThread _object_ is destroyed, the |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // SyncerThread has terminated. We only care about (1) when we are in Stop(), | 133 // SyncerThread has terminated. We only care about (1) when we are in Stop(), |
131 // because we have to manually Run() the task. | 134 // because we have to manually Run() the task. |
132 ConditionVariable syncapi_event_; | 135 ConditionVariable syncapi_event_; |
133 | 136 |
134 DISALLOW_COPY_AND_ASSIGN(UIModelWorker); | 137 DISALLOW_COPY_AND_ASSIGN(UIModelWorker); |
135 }; | 138 }; |
136 | 139 |
137 } // namespace browser_sync | 140 } // namespace browser_sync |
138 | 141 |
139 #endif // CHROME_BROWSER_SYNC_GLUE_UI_MODEL_WORKER_H_ | 142 #endif // CHROME_BROWSER_SYNC_GLUE_UI_MODEL_WORKER_H_ |
OLD | NEW |