| 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 <memory> |
| 9 #include <string> | 10 #include <string> |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/callback.h" | 13 #include "base/callback.h" |
| 13 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 16 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
| 17 #include "base/synchronization/waitable_event.h" | 17 #include "base/synchronization/waitable_event.h" |
| 18 #include "sync/base/sync_export.h" | 18 #include "sync/base/sync_export.h" |
| 19 #include "sync/internal_api/public/base/model_type.h" | 19 #include "sync/internal_api/public/base/model_type.h" |
| 20 #include "sync/internal_api/public/util/syncer_error.h" | 20 #include "sync/internal_api/public/util/syncer_error.h" |
| 21 | 21 |
| 22 namespace base { | 22 namespace base { |
| 23 class DictionaryValue; | 23 class DictionaryValue; |
| 24 } // namespace base | 24 } // namespace base |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // See comments in model_safe_worker.cc for more details. | 145 // See comments in model_safe_worker.cc for more details. |
| 146 base::Callback<void(ModelSafeGroup)> unregister_done_callback_; | 146 base::Callback<void(ModelSafeGroup)> unregister_done_callback_; |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 // A map that details which ModelSafeGroup each ModelType | 149 // A map that details which ModelSafeGroup each ModelType |
| 150 // belongs to. Routing info can change in response to the user enabling / | 150 // belongs to. Routing info can change in response to the user enabling / |
| 151 // disabling sync for certain types, as well as model association completions. | 151 // disabling sync for certain types, as well as model association completions. |
| 152 typedef std::map<ModelType, ModelSafeGroup> ModelSafeRoutingInfo; | 152 typedef std::map<ModelType, ModelSafeGroup> ModelSafeRoutingInfo; |
| 153 | 153 |
| 154 // Caller takes ownership of return value. | 154 // Caller takes ownership of return value. |
| 155 SYNC_EXPORT scoped_ptr<base::DictionaryValue> ModelSafeRoutingInfoToValue( | 155 SYNC_EXPORT std::unique_ptr<base::DictionaryValue> ModelSafeRoutingInfoToValue( |
| 156 const ModelSafeRoutingInfo& routing_info); | 156 const ModelSafeRoutingInfo& routing_info); |
| 157 | 157 |
| 158 SYNC_EXPORT std::string ModelSafeRoutingInfoToString( | 158 SYNC_EXPORT std::string ModelSafeRoutingInfoToString( |
| 159 const ModelSafeRoutingInfo& routing_info); | 159 const ModelSafeRoutingInfo& routing_info); |
| 160 | 160 |
| 161 SYNC_EXPORT ModelTypeSet GetRoutingInfoTypes( | 161 SYNC_EXPORT ModelTypeSet GetRoutingInfoTypes( |
| 162 const ModelSafeRoutingInfo& routing_info); | 162 const ModelSafeRoutingInfo& routing_info); |
| 163 | 163 |
| 164 SYNC_EXPORT ModelSafeGroup GetGroupForModelType( | 164 SYNC_EXPORT ModelSafeGroup GetGroupForModelType( |
| 165 const ModelType type, | 165 const ModelType type, |
| 166 const ModelSafeRoutingInfo& routes); | 166 const ModelSafeRoutingInfo& routes); |
| 167 | 167 |
| 168 } // namespace syncer | 168 } // namespace syncer |
| 169 | 169 |
| 170 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ | 170 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ |
| OLD | NEW |