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

Side by Side Diff: components/sync/driver/glue/browser_thread_model_worker.h

Issue 2503423004: [Sync] Move sync's ModelSafeWorker implementations to engine/. (Closed)
Patch Set: Rebase. Created 4 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 unified diff | Download patch
« no previous file with comments | « components/sync/BUILD.gn ('k') | components/sync/driver/glue/browser_thread_model_worker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 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.
4
5 #ifndef COMPONENTS_SYNC_DRIVER_GLUE_BROWSER_THREAD_MODEL_WORKER_H_
6 #define COMPONENTS_SYNC_DRIVER_GLUE_BROWSER_THREAD_MODEL_WORKER_H_
7
8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/single_thread_task_runner.h"
11 #include "components/sync/base/scoped_event_signal.h"
12 #include "components/sync/base/syncer_error.h"
13 #include "components/sync/engine/model_safe_worker.h"
14
15 namespace syncer {
16
17 // A ModelSafeWorker for models that accept requests from the
18 // syncapi that need to be fulfilled on a browser thread, for example
19 // autofill on the DB thread.
20 // TODO(sync): Try to generalize other ModelWorkers (e.g. history, etc).
21 class BrowserThreadModelWorker : public ModelSafeWorker {
22 public:
23 BrowserThreadModelWorker(
24 const scoped_refptr<base::SingleThreadTaskRunner>& runner,
25 ModelSafeGroup group);
26
27 // ModelSafeWorker implementation.
28 ModelSafeGroup GetModelSafeGroup() override;
29 bool IsOnModelThread() override;
30
31 protected:
32 ~BrowserThreadModelWorker() override;
33
34 SyncerError DoWorkAndWaitUntilDoneImpl(const WorkCallback& work) override;
35
36 void CallDoWorkAndSignalTask(const WorkCallback& work,
37 syncer::ScopedEventSignal scoped_event_signal,
38 SyncerError* error);
39
40 private:
41 scoped_refptr<base::SingleThreadTaskRunner> runner_;
42 ModelSafeGroup group_;
43
44 DISALLOW_COPY_AND_ASSIGN(BrowserThreadModelWorker);
45 };
46
47 } // namespace syncer
48
49 #endif // COMPONENTS_SYNC_DRIVER_GLUE_BROWSER_THREAD_MODEL_WORKER_H_
OLDNEW
« no previous file with comments | « components/sync/BUILD.gn ('k') | components/sync/driver/glue/browser_thread_model_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698