OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ |
6 #define SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
16 #include "base/synchronization/waitable_event.h" | 16 #include "base/synchronization/waitable_event.h" |
17 #include "sync/base/sync_export.h" | 17 #include "sync/base/sync_export.h" |
18 #include "sync/internal_api/public/base/model_type.h" | 18 #include "sync/internal_api/public/base/model_type.h" |
19 #include "sync/internal_api/public/base/model_type_invalidation_map.h" | |
20 #include "sync/internal_api/public/util/syncer_error.h" | 19 #include "sync/internal_api/public/util/syncer_error.h" |
21 | 20 |
22 namespace base { | 21 namespace base { |
23 class DictionaryValue; | 22 class DictionaryValue; |
24 } // namespace | 23 } // namespace |
25 | 24 |
26 namespace syncer { | 25 namespace syncer { |
27 | 26 |
28 // TODO(akalin): Move the non-exported functions in this file to a | 27 // TODO(akalin): Move the non-exported functions in this file to a |
29 // private header. | 28 // private header. |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // disabling sync for certain types, as well as model association completions. | 141 // disabling sync for certain types, as well as model association completions. |
143 typedef std::map<ModelType, ModelSafeGroup> ModelSafeRoutingInfo; | 142 typedef std::map<ModelType, ModelSafeGroup> ModelSafeRoutingInfo; |
144 | 143 |
145 // Caller takes ownership of return value. | 144 // Caller takes ownership of return value. |
146 SYNC_EXPORT_PRIVATE base::DictionaryValue* ModelSafeRoutingInfoToValue( | 145 SYNC_EXPORT_PRIVATE base::DictionaryValue* ModelSafeRoutingInfoToValue( |
147 const ModelSafeRoutingInfo& routing_info); | 146 const ModelSafeRoutingInfo& routing_info); |
148 | 147 |
149 SYNC_EXPORT std::string ModelSafeRoutingInfoToString( | 148 SYNC_EXPORT std::string ModelSafeRoutingInfoToString( |
150 const ModelSafeRoutingInfo& routing_info); | 149 const ModelSafeRoutingInfo& routing_info); |
151 | 150 |
152 // Make a ModelTypeInvalidationMap for all the enabled types in a | |
153 // ModelSafeRoutingInfo using a default payload. | |
154 SYNC_EXPORT_PRIVATE ModelTypeInvalidationMap | |
155 ModelSafeRoutingInfoToInvalidationMap( | |
156 const ModelSafeRoutingInfo& routes, | |
157 const std::string& payload); | |
158 | |
159 SYNC_EXPORT ModelTypeSet GetRoutingInfoTypes( | 151 SYNC_EXPORT ModelTypeSet GetRoutingInfoTypes( |
160 const ModelSafeRoutingInfo& routing_info); | 152 const ModelSafeRoutingInfo& routing_info); |
161 | 153 |
162 SYNC_EXPORT ModelSafeGroup GetGroupForModelType( | 154 SYNC_EXPORT ModelSafeGroup GetGroupForModelType( |
163 const ModelType type, | 155 const ModelType type, |
164 const ModelSafeRoutingInfo& routes); | 156 const ModelSafeRoutingInfo& routes); |
165 | 157 |
166 } // namespace syncer | 158 } // namespace syncer |
167 | 159 |
168 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ | 160 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ |
OLD | NEW |