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..0ee5d32579c7c2fcc8e1eb5f97cb2140dcc41e3c |
| --- /dev/null |
| +++ b/sync/engine/model_type_registry.h |
| @@ -0,0 +1,53 @@ |
| +// 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/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( |
| + syncable::Directory* directory, |
|
Nicolas Zea
2014/01/04 02:09:34
nit: have directory be second param (input/output
rlarocque
2014/01/06 20:03:33
Done.
|
| + const std::vector<ModelSafeWorker*>& workers); |
|
Nicolas Zea
2014/01/04 02:09:34
Given that ModelSafeWorkers are refcounted, I thin
rlarocque
2014/01/06 20:03:33
I agree. This looks wrong to me, too.
However, f
Nicolas Zea
2014/01/07 23:11:40
Fair enough, maybe file a bug to fix this in a sep
rlarocque
2014/01/08 01:37:23
Done: crbug.com/332251
tim (not reviewing)
2014/01/08 19:33:41
I think I traced this back to https://chromiumcode
rlarocque
2014/01/09 00:31:18
Oh, I see what happened there. I think I was tryi
|
| + ~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_; |
|
Nicolas Zea
2014/01/04 02:09:34
DISALLOW_COPY_AND_ASSIGN
rlarocque
2014/01/06 20:03:33
Done.
|
| +}; |
| + |
| +} // namespace syncer |
| + |
| +#endif // SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_ |
| + |