Index: sync/engine/model_type_registry.h |
diff --git a/sync/engine/model_type_registry.h b/sync/engine/model_type_registry.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d3b417c3be15ca08ddb53c2ab88ca7634d3ff920 |
--- /dev/null |
+++ b/sync/engine/model_type_registry.h |
@@ -0,0 +1,56 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_ |
+#define SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_ |
+ |
+#include <map> |
+ |
+#include "base/basictypes.h" |
+#include "base/memory/scoped_ptr.h" |
+#include "sync/base/sync_export.h" |
+#include "sync/internal_api/public/base/model_type.h" |
+#include "sync/internal_api/public/engine/model_safe_worker.h" |
+ |
+namespace syncer { |
+ |
+class CommitterList; |
+class UpdaterList; |
+ |
+namespace syncable { |
+class Directory; |
+} // namespace syncable |
+ |
+class SYNC_EXPORT_PRIVATE ModelTypeRegistry { |
+ public: |
+ ModelTypeRegistry( |
+ const std::vector<ModelSafeWorker*>& workers, |
+ syncable::Directory* directory); |
+ ~ModelTypeRegistry(); |
+ |
+ // Sets the set of enabled types. |
Nicolas Zea
2014/01/07 23:11:40
It seems dangerous that this will destroy the upda
rlarocque
2014/01/08 01:37:24
True, not re-creating them and returning const ref
|
+ void SetEnabledDirectoryTypes(const ModelSafeRoutingInfo& routing_info); |
+ |
+ // Simple getters. |
+ UpdaterList* updater_list(); |
+ CommitterList* committer_list(); |
+ |
+ private: |
+ // Classes to manage the types hooked up to receive and commit sync data. |
+ scoped_ptr<UpdaterList> updater_list_; |
+ scoped_ptr<CommitterList> committer_list_; |
+ |
+ // The known ModelSafeWorkers. |
+ std::map<ModelSafeGroup, scoped_refptr<ModelSafeWorker> > workers_map_; |
+ |
+ // The directory. Not owned. |
+ syncable::Directory* directory_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(ModelTypeRegistry); |
+}; |
+ |
+} // namespace syncer |
+ |
+#endif // SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_ |
+ |