| 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 17 matching lines...) Expand all Loading... |
| 28 // changes to these models don't need to be pushed to a | 28 // changes to these models don't need to be pushed to a |
| 29 // native model. | 29 // native model. |
| 30 GROUP_UI, // Models that live on UI thread and are being synced. | 30 GROUP_UI, // Models that live on UI thread and are being synced. |
| 31 GROUP_DB, // Models that live on DB thread and are being synced. | 31 GROUP_DB, // Models that live on DB thread and are being synced. |
| 32 GROUP_FILE, // Models that live on FILE thread and are being synced. | 32 GROUP_FILE, // Models that live on FILE thread and are being synced. |
| 33 GROUP_HISTORY, // Models that live on history thread and are being | 33 GROUP_HISTORY, // Models that live on history thread and are being |
| 34 // synced. | 34 // synced. |
| 35 GROUP_PASSWORD, // Models that live on the password thread and are | 35 GROUP_PASSWORD, // Models that live on the password thread and are |
| 36 // being synced. On windows and linux, this runs on the | 36 // being synced. On windows and linux, this runs on the |
| 37 // DB thread. | 37 // DB thread. |
| 38 GROUP_CONTROL, // Models that require special handling on the sync |
| 39 // thread. These types have no associated model. |
| 38 MODEL_SAFE_GROUP_COUNT, | 40 MODEL_SAFE_GROUP_COUNT, |
| 39 }; | 41 }; |
| 40 | 42 |
| 41 std::string ModelSafeGroupToString(ModelSafeGroup group); | 43 std::string ModelSafeGroupToString(ModelSafeGroup group); |
| 42 | 44 |
| 43 // The Syncer uses a ModelSafeWorker for all tasks that could potentially | 45 // The Syncer uses a ModelSafeWorker for all tasks that could potentially |
| 44 // modify syncable entries (e.g under a WriteTransaction). The ModelSafeWorker | 46 // modify syncable entries (e.g under a WriteTransaction). The ModelSafeWorker |
| 45 // only knows how to do one thing, and that is take some work (in a fully | 47 // only knows how to do one thing, and that is take some work (in a fully |
| 46 // pre-bound callback) and have it performed (as in Run()) from a thread which | 48 // pre-bound callback) and have it performed (as in Run()) from a thread which |
| 47 // is guaranteed to be "model-safe", where "safe" refers to not allowing us to | 49 // is guaranteed to be "model-safe", where "safe" refers to not allowing us to |
| (...skipping 30 matching lines...) Expand all Loading... |
| 78 | 80 |
| 79 syncable::ModelTypeSet GetRoutingInfoTypes( | 81 syncable::ModelTypeSet GetRoutingInfoTypes( |
| 80 const ModelSafeRoutingInfo& routing_info); | 82 const ModelSafeRoutingInfo& routing_info); |
| 81 | 83 |
| 82 ModelSafeGroup GetGroupForModelType(const syncable::ModelType type, | 84 ModelSafeGroup GetGroupForModelType(const syncable::ModelType type, |
| 83 const ModelSafeRoutingInfo& routes); | 85 const ModelSafeRoutingInfo& routes); |
| 84 | 86 |
| 85 } // namespace csync | 87 } // namespace csync |
| 86 | 88 |
| 87 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ | 89 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ |
| OLD | NEW |