| 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> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 15 #include "sync/internal_api/public/syncable/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/util/syncer_error.h" | 17 #include "sync/internal_api/public/util/syncer_error.h" |
| 17 | 18 |
| 18 namespace base { | 19 namespace base { |
| 19 class DictionaryValue; | 20 class DictionaryValue; |
| 20 } // namespace | 21 } // namespace |
| 21 | 22 |
| 22 namespace syncer { | 23 namespace syncer { |
| 23 | 24 |
| 24 typedef base::Callback<enum SyncerError(void)> WorkCallback; | 25 typedef base::Callback<enum SyncerError(void)> WorkCallback; |
| 25 | 26 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 typedef std::map<syncable::ModelType, ModelSafeGroup> | 70 typedef std::map<syncable::ModelType, ModelSafeGroup> |
| 70 ModelSafeRoutingInfo; | 71 ModelSafeRoutingInfo; |
| 71 | 72 |
| 72 // Caller takes ownership of return value. | 73 // Caller takes ownership of return value. |
| 73 base::DictionaryValue* ModelSafeRoutingInfoToValue( | 74 base::DictionaryValue* ModelSafeRoutingInfoToValue( |
| 74 const ModelSafeRoutingInfo& routing_info); | 75 const ModelSafeRoutingInfo& routing_info); |
| 75 | 76 |
| 76 std::string ModelSafeRoutingInfoToString( | 77 std::string ModelSafeRoutingInfoToString( |
| 77 const ModelSafeRoutingInfo& routing_info); | 78 const ModelSafeRoutingInfo& routing_info); |
| 78 | 79 |
| 80 // Make a ModelTypePayloadMap for all the enabled types in a |
| 81 // ModelSafeRoutingInfo using a default payload. |
| 82 syncable::ModelTypePayloadMap ModelSafeRoutingInfoToPayloadMap( |
| 83 const ModelSafeRoutingInfo& routes, |
| 84 const std::string& payload); |
| 85 |
| 79 syncable::ModelTypeSet GetRoutingInfoTypes( | 86 syncable::ModelTypeSet GetRoutingInfoTypes( |
| 80 const ModelSafeRoutingInfo& routing_info); | 87 const ModelSafeRoutingInfo& routing_info); |
| 81 | 88 |
| 82 ModelSafeGroup GetGroupForModelType(const syncable::ModelType type, | 89 ModelSafeGroup GetGroupForModelType(const syncable::ModelType type, |
| 83 const ModelSafeRoutingInfo& routes); | 90 const ModelSafeRoutingInfo& routes); |
| 84 | 91 |
| 85 } // namespace syncer | 92 } // namespace syncer |
| 86 | 93 |
| 87 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ | 94 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ |
| OLD | NEW |