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

Unified Diff: components/sync/engine_impl/model_type_registry.h

Issue 2644373003: Revert of [Sync] Make directory types registration explicit in ModelTypeRegistry (Closed)
Patch Set: 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
Index: components/sync/engine_impl/model_type_registry.h
diff --git a/components/sync/engine_impl/model_type_registry.h b/components/sync/engine_impl/model_type_registry.h
index 3e25257e86a734439266b5a68c4b7a1536c1014d..5229f0d6c9fc80aeed79187d320def1b779afb59 100644
--- a/components/sync/engine_impl/model_type_registry.h
+++ b/components/sync/engine_impl/model_type_registry.h
@@ -38,17 +38,21 @@
class ModelTypeRegistry : public ModelTypeConnector,
public SyncEncryptionHandler::Observer {
public:
+ // Constructs a ModelTypeRegistry that supports directory types.
ModelTypeRegistry(const std::vector<scoped_refptr<ModelSafeWorker>>& workers,
UserShare* user_share,
NudgeHandler* nudge_handler,
const UssMigrator& uss_migrator);
~ModelTypeRegistry() override;
+ // Sets the set of enabled types.
+ void SetEnabledDirectoryTypes(const ModelSafeRoutingInfo& routing_info);
+
// Enables an off-thread type for syncing. Connects the given proxy
// and its task_runner to the newly created worker.
//
// Expects that the proxy's ModelType is not currently enabled.
- void ConnectNonBlockingType(
+ void ConnectType(
ModelType type,
std::unique_ptr<ActivationContext> activation_context) override;
@@ -56,15 +60,7 @@
//
// Expects that the type is currently enabled.
// Deletes the worker associated with the type.
- void DisconnectNonBlockingType(ModelType type) override;
-
- // Creates update handler and commit contributor objects for directory type.
- // Expects that the type is not yet registered.
- void RegisterDirectoryType(ModelType type, ModelSafeGroup group) override;
-
- // Deletes objects related to directory type. Expects that the type is
- // registered.
- void UnregisterDirectoryType(ModelType type) override;
+ void DisconnectType(ModelType type) override;
// Implementation of SyncEncryptionHandler::Observer.
void OnPassphraseRequired(
@@ -122,9 +118,9 @@
}
// Sets of handlers and contributors.
- std::map<ModelType, std::unique_ptr<DirectoryCommitContributor>>
+ std::vector<std::unique_ptr<DirectoryCommitContributor>>
directory_commit_contributors_;
- std::map<ModelType, std::unique_ptr<DirectoryUpdateHandler>>
+ std::vector<std::unique_ptr<DirectoryUpdateHandler>>
directory_update_handlers_;
std::vector<std::unique_ptr<ModelTypeWorker>> model_type_workers_;
@@ -153,6 +149,9 @@
// The NudgeHandler. Not owned.
NudgeHandler* nudge_handler_;
+ // The set of enabled directory types.
+ ModelTypeSet enabled_directory_types_;
+
// Function to call to migrate data from the directory to USS.
UssMigrator uss_migrator_;
« no previous file with comments | « components/sync/engine_impl/model_type_connector_proxy.cc ('k') | components/sync/engine_impl/model_type_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698