Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / sync / glue / ui_model_worker.h
blob02b8cd31a0365c5008759f20148f9b439d3bb623
1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_SYNC_GLUE_UI_MODEL_WORKER_H_
6 #define CHROME_BROWSER_SYNC_GLUE_UI_MODEL_WORKER_H_
8 #include "base/callback.h"
9 #include "base/compiler_specific.h"
10 #include "base/synchronization/condition_variable.h"
11 #include "base/synchronization/lock.h"
12 #include "sync/internal_api/public/engine/model_safe_worker.h"
13 #include "sync/internal_api/public/util/unrecoverable_error_info.h"
15 namespace browser_sync {
17 // A syncer::ModelSafeWorker for UI models (e.g. bookmarks) that
18 // accepts work requests from the syncapi that need to be fulfilled
19 // from the MessageLoop home to the native model.
20 class UIModelWorker : public syncer::ModelSafeWorker {
21 public:
22 explicit UIModelWorker(syncer::WorkerLoopDestructionObserver* observer);
24 // syncer::ModelSafeWorker implementation. Called on syncapi SyncerThread.
25 virtual void RegisterForLoopDestruction() OVERRIDE;
26 virtual syncer::ModelSafeGroup GetModelSafeGroup() OVERRIDE;
28 protected:
29 virtual syncer::SyncerError DoWorkAndWaitUntilDoneImpl(
30 const syncer::WorkCallback& work) OVERRIDE;
32 private:
33 virtual ~UIModelWorker();
35 DISALLOW_COPY_AND_ASSIGN(UIModelWorker);
38 } // namespace browser_sync
40 #endif // CHROME_BROWSER_SYNC_GLUE_UI_MODEL_WORKER_H_