Chromium Code Reviews| 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_ |
| + |