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

Unified Diff: sync/engine/model_type_registry.h

Issue 93433006: sync: Introduce ModelTypeRegistry and helpers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More review fixes Created 6 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: 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.
tim (not reviewing) 2014/01/08 19:33:42 2014 (check other files)
rlarocque 2014/01/09 00:31:18 Done.
+// 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 {
tim (not reviewing) 2014/01/08 19:33:42 Class comment, and in same vein as the CommitterLi
rlarocque 2014/01/09 00:31:18 Added class comment.
+ public:
+ ModelTypeRegistry(
+ const std::vector<ModelSafeWorker*>& workers,
+ syncable::Directory* directory);
+ ~ModelTypeRegistry();
+
+ // Sets the set of enabled types.
+ 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_
+

Powered by Google App Engine
This is Rietveld 408576698