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 <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // return CANNOT_DO_WORK. | 82 // return CANNOT_DO_WORK. |
83 SyncerError DoWorkAndWaitUntilDone(const WorkCallback& work); | 83 SyncerError DoWorkAndWaitUntilDone(const WorkCallback& work); |
84 | 84 |
85 // Soft stop worker by setting stopped_ flag. Called when sync is disabled | 85 // Soft stop worker by setting stopped_ flag. Called when sync is disabled |
86 // or browser is shutting down. Called on UI loop. | 86 // or browser is shutting down. Called on UI loop. |
87 virtual void RequestStop(); | 87 virtual void RequestStop(); |
88 | 88 |
89 virtual ModelSafeGroup GetModelSafeGroup() = 0; | 89 virtual ModelSafeGroup GetModelSafeGroup() = 0; |
90 | 90 |
91 // MessageLoop::DestructionObserver implementation. | 91 // MessageLoop::DestructionObserver implementation. |
92 virtual void WillDestroyCurrentMessageLoop() OVERRIDE; | 92 virtual void WillDestroyCurrentMessageLoop() override; |
93 | 93 |
94 protected: | 94 protected: |
95 friend class base::RefCountedThreadSafe<ModelSafeWorker>; | 95 friend class base::RefCountedThreadSafe<ModelSafeWorker>; |
96 | 96 |
97 explicit ModelSafeWorker(WorkerLoopDestructionObserver* observer); | 97 explicit ModelSafeWorker(WorkerLoopDestructionObserver* observer); |
98 virtual ~ModelSafeWorker(); | 98 virtual ~ModelSafeWorker(); |
99 | 99 |
100 // Any time the Syncer performs model modifications (e.g employing a | 100 // Any time the Syncer performs model modifications (e.g employing a |
101 // WriteTransaction), it should be done by this method to ensure it is done | 101 // WriteTransaction), it should be done by this method to ensure it is done |
102 // from a model-safe thread. | 102 // from a model-safe thread. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 SYNC_EXPORT ModelTypeSet GetRoutingInfoTypes( | 151 SYNC_EXPORT ModelTypeSet GetRoutingInfoTypes( |
152 const ModelSafeRoutingInfo& routing_info); | 152 const ModelSafeRoutingInfo& routing_info); |
153 | 153 |
154 SYNC_EXPORT ModelSafeGroup GetGroupForModelType( | 154 SYNC_EXPORT ModelSafeGroup GetGroupForModelType( |
155 const ModelType type, | 155 const ModelType type, |
156 const ModelSafeRoutingInfo& routes); | 156 const ModelSafeRoutingInfo& routes); |
157 | 157 |
158 } // namespace syncer | 158 } // namespace syncer |
159 | 159 |
160 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ | 160 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ |
OLD | NEW |