summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/public/engine/passive_model_worker.h
diff options
context:
space:
mode:
Diffstat (limited to 'sync/internal_api/public/engine/passive_model_worker.h')
-rw-r--r--sync/internal_api/public/engine/passive_model_worker.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/sync/internal_api/public/engine/passive_model_worker.h b/sync/internal_api/public/engine/passive_model_worker.h
new file mode 100644
index 0000000..7c0ddf3
--- /dev/null
+++ b/sync/internal_api/public/engine/passive_model_worker.h
@@ -0,0 +1,40 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SYNC_INTERNAL_API_PUBLIC_ENGINE_PASSIVE_MODEL_WORKER_H_
+#define SYNC_INTERNAL_API_PUBLIC_ENGINE_PASSIVE_MODEL_WORKER_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "sync/internal_api/public/engine/model_safe_worker.h"
+#include "sync/internal_api/public/util/syncer_error.h"
+
+class MessageLoop;
+
+namespace browser_sync {
+
+// Implementation of ModelSafeWorker for passive types. All work is
+// done on the same thread DoWorkAndWaitUntilDone (i.e., the sync
+// thread).
+class PassiveModelWorker : public ModelSafeWorker {
+ public:
+ explicit PassiveModelWorker(const MessageLoop* sync_loop);
+
+ // ModelSafeWorker implementation. Called on the sync thread.
+ virtual SyncerError DoWorkAndWaitUntilDone(
+ const WorkCallback& work) OVERRIDE;
+ virtual ModelSafeGroup GetModelSafeGroup() OVERRIDE;
+
+ private:
+ virtual ~PassiveModelWorker();
+
+ const MessageLoop* const sync_loop_;
+
+ DISALLOW_COPY_AND_ASSIGN(PassiveModelWorker);
+};
+
+} // namespace browser_sync
+
+#endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_PASSIVE_MODEL_WORKER_H_