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_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/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 const WorkCallback& work, | 42 const WorkCallback& work, |
43 base::WaitableEvent* work_done, | 43 base::WaitableEvent* work_done, |
44 UIModelWorker* scheduler, | 44 UIModelWorker* scheduler, |
45 UnrecoverableErrorInfo* error_info) | 45 UnrecoverableErrorInfo* error_info) |
46 : work_(work), work_done_(work_done), scheduler_(scheduler), | 46 : work_(work), work_done_(work_done), scheduler_(scheduler), |
47 error_info_(error_info) { | 47 error_info_(error_info) { |
48 } | 48 } |
49 virtual ~CallDoWorkAndSignalTask() { } | 49 virtual ~CallDoWorkAndSignalTask() { } |
50 | 50 |
51 // Task implementation. | 51 // Task implementation. |
52 virtual void Run(); | 52 virtual void Run() OVERRIDE; |
53 | 53 |
54 private: | 54 private: |
55 // Task data - a closure and a waitable event to signal after the work has | 55 // Task data - a closure and a waitable event to signal after the work has |
56 // been done. | 56 // been done. |
57 WorkCallback work_; | 57 WorkCallback work_; |
58 base::WaitableEvent* work_done_; | 58 base::WaitableEvent* work_done_; |
59 | 59 |
60 // The UIModelWorker responsible for scheduling us. | 60 // The UIModelWorker responsible for scheduling us. |
61 UIModelWorker* const scheduler_; | 61 UIModelWorker* const scheduler_; |
62 | 62 |
(...skipping 67 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(), | 130 // SyncerThread has terminated. We only care about (1) when we are in Stop(), |
131 // because we have to manually Run() the task. | 131 // because we have to manually Run() the task. |
132 base::ConditionVariable syncapi_event_; | 132 base::ConditionVariable syncapi_event_; |
133 | 133 |
134 DISALLOW_COPY_AND_ASSIGN(UIModelWorker); | 134 DISALLOW_COPY_AND_ASSIGN(UIModelWorker); |
135 }; | 135 }; |
136 | 136 |
137 } // namespace browser_sync | 137 } // namespace browser_sync |
138 | 138 |
139 #endif // CHROME_BROWSER_SYNC_GLUE_UI_MODEL_WORKER_H_ | 139 #endif // CHROME_BROWSER_SYNC_GLUE_UI_MODEL_WORKER_H_ |
OLD | NEW |