| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_SYNC_ENGINE_MODEL_SAFE_WORKER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_ENGINE_MODEL_SAFE_WORKER_H_ |
| 6 #define CHROME_BROWSER_SYNC_ENGINE_MODEL_SAFE_WORKER_H_ | 6 #define CHROME_BROWSER_SYNC_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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 typedef std::map<syncable::ModelType, ModelSafeGroup> | 71 typedef std::map<syncable::ModelType, ModelSafeGroup> |
| 72 ModelSafeRoutingInfo; | 72 ModelSafeRoutingInfo; |
| 73 | 73 |
| 74 // Caller takes ownership of return value. | 74 // Caller takes ownership of return value. |
| 75 base::DictionaryValue* ModelSafeRoutingInfoToValue( | 75 base::DictionaryValue* ModelSafeRoutingInfoToValue( |
| 76 const ModelSafeRoutingInfo& routing_info); | 76 const ModelSafeRoutingInfo& routing_info); |
| 77 | 77 |
| 78 std::string ModelSafeRoutingInfoToString( | 78 std::string ModelSafeRoutingInfoToString( |
| 79 const ModelSafeRoutingInfo& routing_info); | 79 const ModelSafeRoutingInfo& routing_info); |
| 80 | 80 |
| 81 syncable::ModelEnumSet GetRoutingInfoTypes( | 81 syncable::ModelTypeSet GetRoutingInfoTypes( |
| 82 const ModelSafeRoutingInfo& routing_info); | 82 const ModelSafeRoutingInfo& routing_info); |
| 83 | 83 |
| 84 ModelSafeGroup GetGroupForModelType(const syncable::ModelType type, | 84 ModelSafeGroup GetGroupForModelType(const syncable::ModelType type, |
| 85 const ModelSafeRoutingInfo& routes); | 85 const ModelSafeRoutingInfo& routes); |
| 86 | 86 |
| 87 // Maintain the up-to-date state regarding which ModelSafeWorkers exist and | 87 // Maintain the up-to-date state regarding which ModelSafeWorkers exist and |
| 88 // which types get routed to which worker. When a sync session begins, it will | 88 // which types get routed to which worker. When a sync session begins, it will |
| 89 // snapshot the state at that instant, and will use that for the entire | 89 // snapshot the state at that instant, and will use that for the entire |
| 90 // session. This means if a model becomes synced (or unsynced) by the user | 90 // session. This means if a model becomes synced (or unsynced) by the user |
| 91 // during a sync session, that session will complete and be unaware of this | 91 // during a sync session, that session will complete and be unaware of this |
| (...skipping 13 matching lines...) Expand all Loading... |
| 105 virtual void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out) = 0; | 105 virtual void GetModelSafeRoutingInfo(ModelSafeRoutingInfo* out) = 0; |
| 106 protected: | 106 protected: |
| 107 virtual ~ModelSafeWorkerRegistrar() {} | 107 virtual ~ModelSafeWorkerRegistrar() {} |
| 108 private: | 108 private: |
| 109 DISALLOW_COPY_AND_ASSIGN(ModelSafeWorkerRegistrar); | 109 DISALLOW_COPY_AND_ASSIGN(ModelSafeWorkerRegistrar); |
| 110 }; | 110 }; |
| 111 | 111 |
| 112 } // namespace browser_sync | 112 } // namespace browser_sync |
| 113 | 113 |
| 114 #endif // CHROME_BROWSER_SYNC_ENGINE_MODEL_SAFE_WORKER_H_ | 114 #endif // CHROME_BROWSER_SYNC_ENGINE_MODEL_SAFE_WORKER_H_ |
| OLD | NEW |