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

Unified Diff: components/sync/driver/model_type_controller.h

Issue 2672493002: [Sync] Switch bots to run integ tests for autofill as USS. (Closed)
Patch Set: Updated for Gang's comment. Created 3 years, 10 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: components/sync/driver/model_type_controller.h
diff --git a/components/sync/driver/model_type_controller.h b/components/sync/driver/model_type_controller.h
index cbc315f9f68c0171085378fed9623684aa6a8bac..0e9edd6f059b0e91eb79ddd450c7e4a0d053bffd 100644
--- a/components/sync/driver/model_type_controller.h
+++ b/components/sync/driver/model_type_controller.h
@@ -8,6 +8,7 @@
#include <memory>
#include <string>
+#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/single_thread_task_runner.h"
@@ -19,12 +20,16 @@
namespace syncer {
+class ModelTypeSyncBridge;
class SyncClient;
struct ActivationContext;
// DataTypeController implementation for Unified Sync and Storage model types.
class ModelTypeController : public DataTypeController {
public:
+ using BridgeProvider = base::Callback<base::WeakPtr<ModelTypeSyncBridge>()>;
+ using BridgeTask = base::Callback<void(ModelTypeSyncBridge*)>;
+
ModelTypeController(
ModelType type,
SyncClient* sync_client,
@@ -61,6 +66,15 @@ class ModelTypeController : public DataTypeController {
void OnProcessorStarted(
std::unique_ptr<ActivationContext> activation_context);
+ // Bridge accessor that can be overridden. This will be called on the UI
+ // thread, but the callback will only be run on the model thread.
+ virtual BridgeProvider GetBridgeProvider();
+
+ // Post the given task that requires the bridge object to run to the model
+ // thread, where the bridge lives.
+ void PostBridgeTask(const tracked_objects::Location& location,
+ const BridgeTask& task);
+
// The sync client, which provides access to this type's ModelTypeSyncBridge.
SyncClient* const sync_client_;
« no previous file with comments | « components/browser_sync/profile_sync_components_factory_impl.cc ('k') | components/sync/driver/model_type_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698