Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: sync/internal_api/public/engine/model_safe_worker.h

Issue 642023004: Standardize usage of virtual/override/final in sync/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 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 ~ModelSafeWorker() override;
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.
103 virtual SyncerError DoWorkAndWaitUntilDoneImpl(const WorkCallback& work) = 0; 103 virtual SyncerError DoWorkAndWaitUntilDoneImpl(const WorkCallback& work) = 0;
104 104
105 base::WaitableEvent* work_done_or_stopped() { 105 base::WaitableEvent* work_done_or_stopped() {
106 return &work_done_or_stopped_; 106 return &work_done_or_stopped_;
107 } 107 }
108 108
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 SYNC_EXPORT ModelTypeSet GetRoutingInfoTypes( 157 SYNC_EXPORT ModelTypeSet GetRoutingInfoTypes(
158 const ModelSafeRoutingInfo& routing_info); 158 const ModelSafeRoutingInfo& routing_info);
159 159
160 SYNC_EXPORT ModelSafeGroup GetGroupForModelType( 160 SYNC_EXPORT ModelSafeGroup GetGroupForModelType(
161 const ModelType type, 161 const ModelType type,
162 const ModelSafeRoutingInfo& routes); 162 const ModelSafeRoutingInfo& routes);
163 163
164 } // namespace syncer 164 } // namespace syncer
165 165
166 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ 166 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_
OLDNEW
« no previous file with comments | « sync/internal_api/public/base/cancelation_signal_unittest.cc ('k') | sync/internal_api/public/engine/passive_model_worker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698