| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 virtual ModelSafeGroup GetModelSafeGroup() = 0; | 58 virtual ModelSafeGroup GetModelSafeGroup() = 0; |
| 59 | 59 |
| 60 protected: | 60 protected: |
| 61 virtual ~ModelSafeWorker(); | 61 virtual ~ModelSafeWorker(); |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 friend class base::RefCountedThreadSafe<ModelSafeWorker>; | 64 friend class base::RefCountedThreadSafe<ModelSafeWorker>; |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 // A map that details which ModelSafeGroup each syncable::ModelType | 67 // A map that details which ModelSafeGroup each syncer::ModelType |
| 68 // belongs to. Routing info can change in response to the user enabling / | 68 // belongs to. Routing info can change in response to the user enabling / |
| 69 // disabling sync for certain types, as well as model association completions. | 69 // disabling sync for certain types, as well as model association completions. |
| 70 typedef std::map<syncable::ModelType, ModelSafeGroup> | 70 typedef std::map<syncer::ModelType, ModelSafeGroup> |
| 71 ModelSafeRoutingInfo; | 71 ModelSafeRoutingInfo; |
| 72 | 72 |
| 73 // Caller takes ownership of return value. | 73 // Caller takes ownership of return value. |
| 74 base::DictionaryValue* ModelSafeRoutingInfoToValue( | 74 base::DictionaryValue* ModelSafeRoutingInfoToValue( |
| 75 const ModelSafeRoutingInfo& routing_info); | 75 const ModelSafeRoutingInfo& routing_info); |
| 76 | 76 |
| 77 std::string ModelSafeRoutingInfoToString( | 77 std::string ModelSafeRoutingInfoToString( |
| 78 const ModelSafeRoutingInfo& routing_info); | 78 const ModelSafeRoutingInfo& routing_info); |
| 79 | 79 |
| 80 // Make a ModelTypePayloadMap for all the enabled types in a | 80 // Make a ModelTypePayloadMap for all the enabled types in a |
| 81 // ModelSafeRoutingInfo using a default payload. | 81 // ModelSafeRoutingInfo using a default payload. |
| 82 syncable::ModelTypePayloadMap ModelSafeRoutingInfoToPayloadMap( | 82 syncer::ModelTypePayloadMap ModelSafeRoutingInfoToPayloadMap( |
| 83 const ModelSafeRoutingInfo& routes, | 83 const ModelSafeRoutingInfo& routes, |
| 84 const std::string& payload); | 84 const std::string& payload); |
| 85 | 85 |
| 86 syncable::ModelTypeSet GetRoutingInfoTypes( | 86 syncer::ModelTypeSet GetRoutingInfoTypes( |
| 87 const ModelSafeRoutingInfo& routing_info); | 87 const ModelSafeRoutingInfo& routing_info); |
| 88 | 88 |
| 89 ModelSafeGroup GetGroupForModelType(const syncable::ModelType type, | 89 ModelSafeGroup GetGroupForModelType(const syncer::ModelType type, |
| 90 const ModelSafeRoutingInfo& routes); | 90 const ModelSafeRoutingInfo& routes); |
| 91 | 91 |
| 92 } // namespace syncer | 92 } // namespace syncer |
| 93 | 93 |
| 94 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ | 94 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ |
| OLD | NEW |