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

Unified Diff: chrome/browser/sync/test/engine/fake_model_worker.h

Issue 8625005: [Sync] Make ModelSafeWorker a true interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync to head Created 9 years, 1 month 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: chrome/browser/sync/test/engine/fake_model_worker.h
diff --git a/chrome/browser/sync/test/engine/fake_model_worker.h b/chrome/browser/sync/test/engine/fake_model_worker.h
new file mode 100644
index 0000000000000000000000000000000000000000..28e340b25d42fec3dbb1ee6dacf8c7fdd202ffbc
--- /dev/null
+++ b/chrome/browser/sync/test/engine/fake_model_worker.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2011 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 CHROME_BROWSER_SYNC_TEST_ENGINE_FAKE_MODEL_WORKER_H_
+#define CHROME_BROWSER_SYNC_TEST_ENGINE_FAKE_MODEL_WORKER_H_
+#pragma once
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/threading/non_thread_safe.h"
+#include "chrome/browser/sync/engine/model_safe_worker.h"
+
+namespace browser_sync {
+
+// Fake implementation of ModelSafeWorker that does work on the
+// current thread regardless of the group.
+class FakeModelWorker : public ModelSafeWorker {
+ public:
+ explicit FakeModelWorker(ModelSafeGroup group);
+
+ // ModelSafeWorker implementation.
+ virtual UnrecoverableErrorInfo DoWorkAndWaitUntilDone(
+ const WorkCallback& work) OVERRIDE;
+ virtual ModelSafeGroup GetModelSafeGroup() OVERRIDE;
+
+ private:
+ virtual ~FakeModelWorker();
+
+ base::NonThreadSafe non_thread_safe_;
+
+ const ModelSafeGroup group_;
+
+ DISALLOW_COPY_AND_ASSIGN(FakeModelWorker);
+};
+
+} // namespace browser_sync
+
+#endif // CHROME_BROWSER_SYNC_TEST_ENGINE_FAKE_MODEL_WORKER_H_
+

Powered by Google App Engine
This is Rietveld 408576698