Chromium Code Reviews| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 // |unregister_done_callback|. | 77 // |unregister_done_callback|. |
| 78 virtual void UnregisterForLoopDestruction( | 78 virtual void UnregisterForLoopDestruction( |
| 79 base::Callback<void(ModelSafeGroup)> unregister_done_callback); | 79 base::Callback<void(ModelSafeGroup)> unregister_done_callback); |
| 80 | 80 |
| 81 // If not stopped, call DoWorkAndWaitUntilDoneImpl() to do work. Otherwise | 81 // If not stopped, call DoWorkAndWaitUntilDoneImpl() to do work. Otherwise |
| 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. | 86 // or browser is shutting down. |
| 87 void RequestStop(); | 87 virtual void RequestStop(); |
|
Nicolas Zea
2013/09/16 17:37:51
Is this always called on the UI thread? Perhaps ad
haitaol1
2013/09/16 18:07:39
Done.
| |
| 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); |
| (...skipping 53 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 |