| 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 COMPONENTS_SYNC_ENGINE_MODEL_SAFE_WORKER_H_ | 5 #ifndef COMPONENTS_SYNC_ENGINE_MODEL_SAFE_WORKER_H_ |
| 6 #define COMPONENTS_SYNC_ENGINE_MODEL_SAFE_WORKER_H_ | 6 #define COMPONENTS_SYNC_ENGINE_MODEL_SAFE_WORKER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 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 "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 16 #include "base/single_thread_task_runner.h" | 16 #include "base/single_thread_task_runner.h" |
| 17 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
| 18 #include "base/synchronization/waitable_event.h" | 18 #include "base/synchronization/waitable_event.h" |
| 19 #include "components/sync/base/model_type.h" | 19 #include "components/sync/base/model_type.h" |
| 20 #include "components/sync/base/syncer_error.h" | 20 #include "components/sync/base/syncer_error.h" |
| 21 | 21 |
| 22 namespace base { | 22 namespace base { |
| 23 class DictionaryValue; | 23 class DictionaryValue; |
| 24 } // namespace base | 24 } // namespace base |
| 25 | 25 |
| 26 namespace syncer { | 26 namespace syncer { |
| 27 | 27 |
| 28 // TODO(akalin): Move the non-exported functions in this file to a | |
| 29 // private header. | |
| 30 | |
| 31 typedef base::Callback<enum SyncerError(void)> WorkCallback; | 28 typedef base::Callback<enum SyncerError(void)> WorkCallback; |
| 32 | 29 |
| 33 enum ModelSafeGroup { | 30 enum ModelSafeGroup { |
| 34 GROUP_PASSIVE = 0, // Models that are just "passively" being synced; e.g. | 31 GROUP_PASSIVE = 0, // Models that are just "passively" being synced; e.g. |
| 35 // changes to these models don't need to be pushed to a | 32 // changes to these models don't need to be pushed to a |
| 36 // native model. | 33 // native model. |
| 37 GROUP_UI, // Models that live on UI thread and are being synced. | 34 GROUP_UI, // Models that live on UI thread and are being synced. |
| 38 GROUP_DB, // Models that live on DB thread and are being synced. | 35 GROUP_DB, // Models that live on DB thread and are being synced. |
| 39 GROUP_FILE, // Models that live on FILE thread and are being synced. | 36 GROUP_FILE, // Models that live on FILE thread and are being synced. |
| 40 GROUP_HISTORY, // Models that live on history thread and are being | 37 GROUP_HISTORY, // Models that live on history thread and are being |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 const ModelSafeRoutingInfo& routing_info); | 153 const ModelSafeRoutingInfo& routing_info); |
| 157 | 154 |
| 158 ModelTypeSet GetRoutingInfoTypes(const ModelSafeRoutingInfo& routing_info); | 155 ModelTypeSet GetRoutingInfoTypes(const ModelSafeRoutingInfo& routing_info); |
| 159 | 156 |
| 160 ModelSafeGroup GetGroupForModelType(const ModelType type, | 157 ModelSafeGroup GetGroupForModelType(const ModelType type, |
| 161 const ModelSafeRoutingInfo& routes); | 158 const ModelSafeRoutingInfo& routes); |
| 162 | 159 |
| 163 } // namespace syncer | 160 } // namespace syncer |
| 164 | 161 |
| 165 #endif // COMPONENTS_SYNC_ENGINE_MODEL_SAFE_WORKER_H_ | 162 #endif // COMPONENTS_SYNC_ENGINE_MODEL_SAFE_WORKER_H_ |
| OLD | NEW |