Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(727)

Unified Diff: sync/internal_api/public/engine/control_model_worker.h

Issue 10832286: sync: Introduce control data types (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sync/internal_api/public/engine/control_model_worker.h
diff --git a/sync/internal_api/public/engine/control_model_worker.h b/sync/internal_api/public/engine/control_model_worker.h
new file mode 100644
index 0000000000000000000000000000000000000000..20e5488bc29c6fbc6839e1c54370cace4d9b77fc
--- /dev/null
+++ b/sync/internal_api/public/engine/control_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_CONTROL_MODEL_WORKER_H_
+#define SYNC_INTERNAL_API_PUBLIC_ENGINE_CONTROL_MODEL_WORKER_H_
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "sync/base/sync_export.h"
+#include "sync/internal_api/public/engine/model_safe_worker.h"
+#include "sync/internal_api/public/util/syncer_error.h"
+
+class MessageLoop;
+
+namespace syncer {
+
+// Implementation of ModelSafeWorker for control types. All work is
+// done on the same thread DoWorkAndWaitUntilDone (i.e., the sync
+// thread).
+class SYNC_EXPORT ControlModelWorker : public ModelSafeWorker {
+ public:
+ explicit ControlModelWorker(const MessageLoop* sync_loop);
+
+ // ModelSafeWorker implementation. Called on the sync thread.
+ virtual SyncerError DoWorkAndWaitUntilDone(
+ const WorkCallback& work) OVERRIDE;
+ virtual ModelSafeGroup GetModelSafeGroup() OVERRIDE;
+
+ private:
+ virtual ~ControlModelWorker();
+
+ const MessageLoop* const sync_loop_;
+
+ DISALLOW_COPY_AND_ASSIGN(ControlModelWorker);
+};
+
+} // namespace syncer
+
+#endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_CONTROL_MODEL_WORKER_H_

Powered by Google App Engine
This is Rietveld 408576698