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/memory/scoped_vector.h" | 12 #include "base/memory/scoped_vector.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 #include "sync/internal_api/public/sessions/type_debug_info_observer.h" |
16 | 17 |
17 namespace syncer { | 18 namespace syncer { |
18 | 19 |
19 namespace syncable { | 20 namespace syncable { |
20 class Directory; | 21 class Directory; |
21 } // namespace syncable | 22 } // namespace syncable |
22 | 23 |
23 class CommitContributor; | 24 class CommitContributor; |
24 class DirectoryCommitContributor; | 25 class DirectoryCommitContributor; |
25 class DirectoryUpdateHandler; | 26 class DirectoryUpdateHandler; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 97 |
97 // The known ModelSafeWorkers. | 98 // The known ModelSafeWorkers. |
98 std::map<ModelSafeGroup, scoped_refptr<ModelSafeWorker> > workers_map_; | 99 std::map<ModelSafeGroup, scoped_refptr<ModelSafeWorker> > workers_map_; |
99 | 100 |
100 // The directory. Not owned. | 101 // The directory. Not owned. |
101 syncable::Directory* directory_; | 102 syncable::Directory* directory_; |
102 | 103 |
103 // The set of enabled directory types. | 104 // The set of enabled directory types. |
104 ModelTypeSet enabled_directory_types_; | 105 ModelTypeSet enabled_directory_types_; |
105 | 106 |
| 107 // The set of observers of per-type debug info. |
| 108 // |
| 109 // Each of the DirectoryTypeDebugInfoEmitters needs such a list. There's |
| 110 // a lot of them, and their lifetimes are unpredictable, so it makes the |
| 111 // book-keeping easier if we just store the list here. That way it's |
| 112 // guaranteed to live as long as this sync backend. |
| 113 ObserverList<TypeDebugInfoObserver> type_debug_info_observers_; |
| 114 |
106 DISALLOW_COPY_AND_ASSIGN(ModelTypeRegistry); | 115 DISALLOW_COPY_AND_ASSIGN(ModelTypeRegistry); |
107 }; | 116 }; |
108 | 117 |
109 } // namespace syncer | 118 } // namespace syncer |
110 | 119 |
111 #endif // SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_ | 120 #endif // SYNC_ENGINE_MODEL_TYPE_REGISTRY_H_ |
112 | 121 |
OLD | NEW |