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

Unified Diff: chrome/browser/sync/glue/browser_thread_model_worker.h

Issue 7891054: Add GROUP_FILE ModelSafeGroup (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Remove FileModelWorkers Created 9 years, 3 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: chrome/browser/sync/glue/browser_thread_model_worker.h
diff --git a/chrome/browser/sync/glue/browser_thread_model_worker.h b/chrome/browser/sync/glue/browser_thread_model_worker.h
new file mode 100644
index 0000000000000000000000000000000000000000..5674079ea221cf60dd36a0f2caac36573988316b
--- /dev/null
+++ b/chrome/browser/sync/glue/browser_thread_model_worker.h
@@ -0,0 +1,44 @@
+// 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_GLUE_BROWSER_THREAD_MODEL_WORKER_H_
+#define CHROME_BROWSER_SYNC_GLUE_BROWSER_THREAD_MODEL_WORKER_H_
+#pragma once
+
+#include "base/callback.h"
+#include "base/basictypes.h"
+#include "chrome/browser/sync/engine/model_safe_worker.h"
+#include "content/browser/browser_thread.h"
+
+namespace base {
+class WaitableEvent;
+}
+
+namespace browser_sync {
+
+// A ModelSafeWorker for models that accept requests from the syncapi that need
+// to be fulfilled on a browser thread, for example autofill on the DB thread.
+// TODO(sync): Try to generalize other ModelWorkers (e.g. history, etc).
+class BrowserThreadModelWorker : public browser_sync::ModelSafeWorker {
+ public:
+ BrowserThreadModelWorker(BrowserThread::ID thread, ModelSafeGroup group);
+ virtual ~BrowserThreadModelWorker();
+
+ // ModelSafeWorker implementation. Called on syncapi SyncerThread.
akalin 2011/09/14 19:16:32 "syncapi SyncerThread" -> "the sync thread"
not at google - send to devlin 2011/09/14 20:39:03 Done.
+ virtual void DoWorkAndWaitUntilDone(Callback0::Type* work);
+ virtual ModelSafeGroup GetModelSafeGroup();
+
+ private:
+ void CallDoWorkAndSignalTask(
+ Callback0::Type* work, base::WaitableEvent* done);
+
+ BrowserThread::ID thread_;
+ ModelSafeGroup group_;
+
+ DISALLOW_COPY_AND_ASSIGN(BrowserThreadModelWorker);
+};
+
+} // namespace browser_sync
+
+#endif // CHROME_BROWSER_SYNC_GLUE_BROWSER_THREAD_MODEL_WORKER_H_

Powered by Google App Engine
This is Rietveld 408576698