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

Unified Diff: components/sync/driver/glue/sync_backend_host_core.h

Issue 2538023002: [Sync] Pass a TaskRunner into SBHI/SBHC, not a thread or message loop. (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: components/sync/driver/glue/sync_backend_host_core.h
diff --git a/components/sync/driver/glue/sync_backend_host_core.h b/components/sync/driver/glue/sync_backend_host_core.h
index 129c63d3293ba2c47056e0105e43a662c3bf99ba..3737f513cc98ee658b0eef09f3d88c9a022c0dcf 100644
--- a/components/sync/driver/glue/sync_backend_host_core.h
+++ b/components/sync/driver/glue/sync_backend_host_core.h
@@ -14,6 +14,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
+#include "base/single_thread_task_runner.h"
#include "base/timer/timer.h"
#include "base/trace_event/memory_dump_provider.h"
#include "components/invalidation/public/invalidation.h"
@@ -32,7 +33,7 @@ class SyncBackendHostImpl;
// Utility struct for holding initialization options.
struct DoInitializeOptions {
DoInitializeOptions(
- base::MessageLoop* sync_loop,
+ scoped_refptr<base::SingleThreadTaskRunner> sync_task_runner,
SyncBackendRegistrar* registrar,
const std::vector<scoped_refptr<ModelSafeWorker>>& workers,
const scoped_refptr<ExtensionsActivity>& extensions_activity,
@@ -55,7 +56,7 @@ struct DoInitializeOptions {
const std::map<ModelType, int64_t>& invalidation_versions);
~DoInitializeOptions();
- base::MessageLoop* sync_loop;
+ scoped_refptr<base::SingleThreadTaskRunner> sync_task_runner;
SyncBackendRegistrar* registrar;
std::vector<scoped_refptr<ModelSafeWorker>> workers;
scoped_refptr<ExtensionsActivity> extensions_activity;
@@ -277,9 +278,8 @@ class SyncBackendHostCore
// Our parent SyncBackendHost.
WeakHandle<SyncBackendHostImpl> host_;
- // The loop where all the sync backend operations happen.
- // Non-null only between calls to DoInitialize() and ~Core().
- base::MessageLoop* sync_loop_;
+ // The task runner where all the sync engine operations happen.
+ scoped_refptr<base::SingleThreadTaskRunner> sync_task_runner_;
// Our parent's registrar (not owned). Non-null only between
// calls to DoInitialize() and DoShutdown().

Powered by Google App Engine
This is Rietveld 408576698