Index: chrome/browser/sync/glue/ui_model_worker.h |
diff --git a/chrome/browser/sync/glue/ui_model_worker.h b/chrome/browser/sync/glue/ui_model_worker.h |
index 8704ec4b836c0170ca42cfbb895e8f30932a58aa..3fa38e2ac592e0fc0a74c6c51a080eb1499a5d2e 100644 |
--- a/chrome/browser/sync/glue/ui_model_worker.h |
+++ b/chrome/browser/sync/glue/ui_model_worker.h |
@@ -24,7 +24,7 @@ namespace browser_sync { |
// after the actual syncer pthread has exited. |
class UIModelWorker : public syncer::ModelSafeWorker { |
public: |
- UIModelWorker(); |
+ explicit UIModelWorker(syncer::WorkerLoopDestructionObserver* observer); |
// Called by the UI thread on shutdown of the sync service. Blocks until |
// the UIModelWorker has safely met termination conditions, namely that |
@@ -33,8 +33,7 @@ class UIModelWorker : public syncer::ModelSafeWorker { |
void Stop(); |
// syncer::ModelSafeWorker implementation. Called on syncapi SyncerThread. |
- virtual syncer::SyncerError DoWorkAndWaitUntilDone( |
- const syncer::WorkCallback& work) OVERRIDE; |
+ virtual void RegisterForLoopDestruction() OVERRIDE; |
virtual syncer::ModelSafeGroup GetModelSafeGroup() OVERRIDE; |
// Upon receiving this idempotent call, the syncer::ModelSafeWorker can |
@@ -47,6 +46,11 @@ class UIModelWorker : public syncer::ModelSafeWorker { |
// Called on ui loop. |
void OnTaskCompleted() { pending_work_.Reset(); } |
+ protected: |
+ virtual syncer::SyncerError DoWorkAndWaitUntilDoneImpl( |
+ const syncer::WorkCallback& work, |
+ base::WaitableEvent* work_done) OVERRIDE; |
+ |
private: |
// The life-cycle of a UIModelWorker in three states. |
enum State { |
@@ -66,6 +70,10 @@ class UIModelWorker : public syncer::ModelSafeWorker { |
virtual ~UIModelWorker(); |
+ void CallDoWorkAndSignalCallback(const syncer::WorkCallback& work, |
+ base::WaitableEvent* work_done, |
+ syncer::SyncerError* error_info); |
+ |
// This is set by the UI thread, but is not explicitly thread safe, so only |
// read this value from other threads when you know it is absolutely safe. |
State state_; |