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

Unified Diff: components/sync/engine/model_type_connector.h

Issue 2641523004: [Sync] Make directory types registration explicit in ModelTypeRegistry (Closed)
Patch Set: Address comments Created 3 years, 11 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
« no previous file with comments | « components/sync/engine/model_type_configurer.h ('k') | components/sync/engine/sync_engine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/engine/model_type_connector.h
diff --git a/components/sync/engine/model_type_connector.h b/components/sync/engine/model_type_connector.h
index 19171001c25f5899976d550a2c3675a506447ef3..d95d8dec26b103890fda93973f901c6ce9f54839 100644
--- a/components/sync/engine/model_type_connector.h
+++ b/components/sync/engine/model_type_connector.h
@@ -8,13 +8,17 @@
#include <memory>
#include "components/sync/base/model_type.h"
+#include "components/sync/engine/model_safe_worker.h"
namespace syncer {
struct ActivationContext;
-// An interface into the core parts of sync for USS model types. Handles
-// creating the connection between the ModelTypeWorker (CommitQueue) on the sync
-// side and the (Shared)ModelTypeProcessor on the model type side.
+// An interface into the core parts of sync for model types. By adding/removing
+// types through methods of this interface consumer controls which types will be
+// syncing (receiving updates and committing local changes).
+// In addition it handles creating the connection between the ModelTypeWorker
+// (CommitQueue) on the sync side and the (Shared)ModelTypeProcessor on the
+// model type side for non-blocking types.
class ModelTypeConnector {
public:
ModelTypeConnector();
@@ -24,7 +28,7 @@ class ModelTypeConnector {
// thread. Note that in production |activation_context| actually owns a
// processor proxy that forwards calls to the model thread and is safe to call
// from the sync thread.
- virtual void ConnectType(
+ virtual void ConnectNonBlockingType(
ModelType type,
std::unique_ptr<ActivationContext> activation_context) = 0;
@@ -33,7 +37,16 @@ class ModelTypeConnector {
// This is the sync thread's chance to clear state associated with the type.
// It also causes the syncer to stop requesting updates for this type, and to
// abort any in-progress commit requests.
- virtual void DisconnectType(ModelType type) = 0;
+ virtual void DisconnectNonBlockingType(ModelType type) = 0;
+
+ // Registers directory based type with sync engine. Sync engine will create
+ // update handler and commit contributor objects for this type. It will start
+ // including the type in GetUpdates and commit requests.
+ virtual void RegisterDirectoryType(ModelType type, ModelSafeGroup group) = 0;
+
+ // Unregisters directory based type from sync engine. Type will no longer be
+ // included in communications with server.
+ virtual void UnregisterDirectoryType(ModelType type) = 0;
};
} // namespace syncer
« no previous file with comments | « components/sync/engine/model_type_configurer.h ('k') | components/sync/engine/sync_engine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698