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

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

Issue 1848793006: [Sync] Register USS types with ModelTypeRegistry before download (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 13 matching lines...) Expand all
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 28 // TODO(akalin): Move the non-exported functions in this file to a
29 // private header. 29 // private header.
30 30
31 typedef base::Callback<enum SyncerError(void)> WorkCallback; 31 typedef base::Callback<enum SyncerError(void)> WorkCallback;
32 32
33 enum ModelSafeGroup { 33 enum ModelSafeGroup {
34 GROUP_PASSIVE = 0, // Models that are just "passively" being synced; e.g. 34 GROUP_PASSIVE = 0, // Models that are just "passively" being synced; e.g.
skym 2016/04/01 21:58:22 Can you update to make it clear that non-blocking
pavely 2016/04/04 17:57:16 Done.
35 // changes to these models don't need to be pushed to a 35 // changes to these models don't need to be pushed to a
36 // native model. 36 // native model.
37 GROUP_UI, // Models that live on UI thread and are being synced. 37 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. 38 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. 39 GROUP_FILE, // Models that live on FILE thread and are being synced.
40 GROUP_HISTORY, // Models that live on history thread and are being 40 GROUP_HISTORY, // Models that live on history thread and are being
41 // synced. 41 // synced.
42 GROUP_PASSWORD, // Models that live on the password thread and are 42 GROUP_PASSWORD, // Models that live on the password thread and are
43 // being synced. On windows and linux, this runs on the 43 // being synced. On windows and linux, this runs on the
44 // DB thread. 44 // DB thread.
45 GROUP_NON_BLOCKING, // Models that correspond to non-blocking types.
skym 2016/04/01 21:58:21 So as we migrate to USS, we'll be slowly switching
pavely 2016/04/04 17:57:16 Yes. As we switch data type controllers to be deri
45 MODEL_SAFE_GROUP_COUNT, 46 MODEL_SAFE_GROUP_COUNT,
skym 2016/04/01 21:58:22 Doesn't look like this value is ever used.
pavely 2016/04/04 17:57:16 Done.
46 }; 47 };
47 48
48 SYNC_EXPORT std::string ModelSafeGroupToString(ModelSafeGroup group); 49 SYNC_EXPORT std::string ModelSafeGroupToString(ModelSafeGroup group);
49 50
50 // WorkerLoopDestructionObserver is notified when the thread where it works 51 // WorkerLoopDestructionObserver is notified when the thread where it works
51 // is going to be destroyed. 52 // is going to be destroyed.
52 class WorkerLoopDestructionObserver { 53 class WorkerLoopDestructionObserver {
53 public: 54 public:
54 virtual void OnWorkerLoopDestroyed(ModelSafeGroup group) = 0; 55 virtual void OnWorkerLoopDestroyed(ModelSafeGroup group) = 0;
55 }; 56 };
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 SYNC_EXPORT ModelTypeSet GetRoutingInfoTypes( 159 SYNC_EXPORT ModelTypeSet GetRoutingInfoTypes(
159 const ModelSafeRoutingInfo& routing_info); 160 const ModelSafeRoutingInfo& routing_info);
160 161
161 SYNC_EXPORT ModelSafeGroup GetGroupForModelType( 162 SYNC_EXPORT ModelSafeGroup GetGroupForModelType(
162 const ModelType type, 163 const ModelType type,
163 const ModelSafeRoutingInfo& routes); 164 const ModelSafeRoutingInfo& routes);
164 165
165 } // namespace syncer 166 } // namespace syncer
166 167
167 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_ 168 #endif // SYNC_INTERNAL_API_PUBLIC_ENGINE_MODEL_SAFE_WORKER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698