| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_ | 5 #ifndef SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_ |
| 6 #define SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_ | 6 #define SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "sync/base/sync_export.h" | 13 #include "sync/base/sync_export.h" |
| 14 #include "sync/internal_api/public/base/model_type.h" | 14 #include "sync/internal_api/public/base/model_type.h" |
| 15 #include "sync/internal_api/public/engine/model_safe_worker.h" | 15 #include "sync/internal_api/public/engine/model_safe_worker.h" |
| 16 | 16 |
| 17 namespace syncer { | 17 namespace syncer { |
| 18 | 18 |
| 19 namespace syncable { | 19 namespace syncable { |
| 20 class Directory; | 20 class Directory; |
| 21 } // namespace syncable | 21 } // namespace syncable |
| 22 | 22 |
| 23 class SyncDirectoryUpdateHandler; | 23 class UpdateHandler; |
| 24 class SyncDirectoryCommitContributor; | 24 class CommitContributor; |
| 25 | 25 |
| 26 typedef std::map<ModelType, SyncDirectoryUpdateHandler*> UpdateHandlerMap; | 26 typedef std::map<ModelType, UpdateHandler*> UpdateHandlerMap; |
| 27 typedef std::map<ModelType, SyncDirectoryCommitContributor*> | 27 typedef std::map<ModelType, CommitContributor*> CommitContributorMap; |
| 28 CommitContributorMap; | |
| 29 | 28 |
| 30 // Keeps track of the sets of active update handlers and commit contributors. | 29 // Keeps track of the sets of active update handlers and commit contributors. |
| 31 class SYNC_EXPORT_PRIVATE ModelTypeRegistry { | 30 class SYNC_EXPORT_PRIVATE ModelTypeRegistry { |
| 32 public: | 31 public: |
| 33 ModelTypeRegistry( | 32 ModelTypeRegistry( |
| 34 const std::vector<scoped_refptr<ModelSafeWorker> >& workers, | 33 const std::vector<scoped_refptr<ModelSafeWorker> >& workers, |
| 35 syncable::Directory* directory); | 34 syncable::Directory* directory); |
| 36 ~ModelTypeRegistry(); | 35 ~ModelTypeRegistry(); |
| 37 | 36 |
| 38 // Sets the set of enabled types. | 37 // Sets the set of enabled types. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 59 // The directory. Not owned. | 58 // The directory. Not owned. |
| 60 syncable::Directory* directory_; | 59 syncable::Directory* directory_; |
| 61 | 60 |
| 62 DISALLOW_COPY_AND_ASSIGN(ModelTypeRegistry); | 61 DISALLOW_COPY_AND_ASSIGN(ModelTypeRegistry); |
| 63 }; | 62 }; |
| 64 | 63 |
| 65 } // namespace syncer | 64 } // namespace syncer |
| 66 | 65 |
| 67 #endif // SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_ | 66 #endif // SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_ |
| 68 | 67 |
| OLD | NEW |