| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "sync/base/sync_export.h" | 14 #include "sync/base/sync_export.h" |
| 15 #include "sync/internal_api/public/base/model_type.h" | 15 #include "sync/internal_api/public/base/model_type.h" |
| 16 #include "sync/internal_api/public/base/model_type_payload_map.h" | 16 #include "sync/internal_api/public/base/model_type_state_map.h" |
| 17 #include "sync/internal_api/public/util/syncer_error.h" | 17 #include "sync/internal_api/public/util/syncer_error.h" |
| 18 | 18 |
| 19 namespace base { | 19 namespace base { |
| 20 class DictionaryValue; | 20 class DictionaryValue; |
| 21 } // namespace | 21 } // namespace |
| 22 | 22 |
| 23 namespace syncer { | 23 namespace syncer { |
| 24 | 24 |
| 25 // TODO(akalin): Move the non-exported functions in this file to a | 25 // TODO(akalin): Move the non-exported functions in this file to a |
| 26 // private header. | 26 // private header. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // disabling sync for certain types, as well as model association completions. | 73 // disabling sync for certain types, as well as model association completions. |
| 74 typedef std::map<ModelType, ModelSafeGroup> ModelSafeRoutingInfo; | 74 typedef std::map<ModelType, ModelSafeGroup> ModelSafeRoutingInfo; |
| 75 | 75 |
| 76 // Caller takes ownership of return value. | 76 // Caller takes ownership of return value. |
| 77 base::DictionaryValue* ModelSafeRoutingInfoToValue( | 77 base::DictionaryValue* ModelSafeRoutingInfoToValue( |
| 78 const ModelSafeRoutingInfo& routing_info); | 78 const ModelSafeRoutingInfo& routing_info); |
| 79 | 79 |
| 80 SYNC_EXPORT std::string ModelSafeRoutingInfoToString( | 80 SYNC_EXPORT std::string ModelSafeRoutingInfoToString( |
| 81 const ModelSafeRoutingInfo& routing_info); | 81 const ModelSafeRoutingInfo& routing_info); |
| 82 | 82 |
| 83 // Make a ModelTypePayloadMap for all the enabled types in a | 83 // Make a ModelTypeStateMap for all the enabled types in a |
| 84 // ModelSafeRoutingInfo using a default payload. | 84 // ModelSafeRoutingInfo using a default payload. |
| 85 ModelTypePayloadMap ModelSafeRoutingInfoToPayloadMap( | 85 ModelTypeStateMap ModelSafeRoutingInfoToStateMap( |
| 86 const ModelSafeRoutingInfo& routes, | 86 const ModelSafeRoutingInfo& routes, |
| 87 const std::string& payload); | 87 const std::string& payload); |
| 88 | 88 |
| 89 SYNC_EXPORT ModelTypeSet GetRoutingInfoTypes( | 89 SYNC_EXPORT ModelTypeSet GetRoutingInfoTypes( |
| 90 const ModelSafeRoutingInfo& routing_info); | 90 const ModelSafeRoutingInfo& routing_info); |
| 91 | 91 |
| 92 SYNC_EXPORT ModelSafeGroup GetGroupForModelType( | 92 SYNC_EXPORT ModelSafeGroup GetGroupForModelType( |
| 93 const ModelType type, | 93 const ModelType type, |
| 94 const ModelSafeRoutingInfo& routes); | 94 const ModelSafeRoutingInfo& routes); |
| 95 | 95 |
| 96 } // namespace syncer | 96 } // namespace syncer |
| 97 | 97 |
| 98 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ | 98 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ |
| OLD | NEW |