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

Unified Diff: components/sync/syncable/model_type.cc

Issue 2859033002: [sync] Add constexpr to EnumSet (Closed)
Patch Set: Add constexpr to EnumSet Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: components/sync/syncable/model_type.cc
diff --git a/components/sync/syncable/model_type.cc b/components/sync/syncable/model_type.cc
index e1f4d49d127d3afc456ce0b151094b3d16c65c8c..cca0f01c003e950c9c54cfc6a9040c198d0e54a5 100644
--- a/components/sync/syncable/model_type.cc
+++ b/components/sync/syncable/model_type.cc
@@ -429,25 +429,6 @@ ModelTypeSet ProtocolTypes() {
return Difference(ModelTypeSet::All(), ProxyTypes());
}
-ModelTypeSet UserTypes() {
- // TODO(sync): We should be able to build the actual enumset's internal
- // bitset value here at compile time, instead of makes a new one each time.
- return ModelTypeSet::FromRange(FIRST_USER_MODEL_TYPE, LAST_USER_MODEL_TYPE);
-}
-
-ModelTypeSet UserSelectableTypes() {
- return ModelTypeSet(BOOKMARKS, PREFERENCES, PASSWORDS, AUTOFILL, THEMES,
- TYPED_URLS, EXTENSIONS, APPS,
-#if BUILDFLAG(ENABLE_READING_LIST)
- READING_LIST,
-#endif
- PROXY_TABS);
-}
-
-bool IsUserSelectableType(ModelType model_type) {
- return UserSelectableTypes().Has(model_type);
-}
-
ModelTypeNameMap GetUserSelectableTypeNameMap() {
ModelTypeNameMap type_names;
ModelTypeSet type_set = UserSelectableTypes();
@@ -499,33 +480,13 @@ ModelTypeSet EncryptableUserTypes() {
return encryptable_user_types;
}
-ModelTypeSet PriorityUserTypes() {
- return ModelTypeSet(DEVICE_INFO, PRIORITY_PREFERENCES);
-}
-
-ModelTypeSet ControlTypes() {
- // TODO(sync): We should be able to build the actual enumset's internal
- // bitset value here at compile time, instead of makes a new one each time.
- return ModelTypeSet::FromRange(FIRST_CONTROL_MODEL_TYPE,
- LAST_CONTROL_MODEL_TYPE);
-}
-
-ModelTypeSet ProxyTypes() {
- return ModelTypeSet::FromRange(FIRST_PROXY_TYPE, LAST_PROXY_TYPE);
-}
-
-bool IsControlType(ModelType model_type) {
- return ControlTypes().Has(model_type);
-}
-
ModelTypeSet CoreTypes() {
ModelTypeSet result = PriorityCoreTypes();
// The following are low priority core types.
- result.Put(SYNCED_NOTIFICATIONS);
- result.Put(SYNCED_NOTIFICATION_APP_INFO);
- result.Put(SUPERVISED_USER_SHARED_SETTINGS);
- result.Put(SUPERVISED_USER_WHITELISTS);
+ result.PutAll(ModelTypeSet(SYNCED_NOTIFICATIONS, SYNCED_NOTIFICATION_APP_INFO,
+ SUPERVISED_USER_SHARED_SETTINGS,
+ SUPERVISED_USER_WHITELISTS));
return result;
}
@@ -534,8 +495,7 @@ ModelTypeSet PriorityCoreTypes() {
ModelTypeSet result = ControlTypes();
// The following are non-control core types.
- result.Put(SUPERVISED_USERS);
- result.Put(SUPERVISED_USER_SETTINGS);
+ result.PutAll(ModelTypeSet(SUPERVISED_USERS, SUPERVISED_USER_SETTINGS));
return result;
}

Powered by Google App Engine
This is Rietveld 408576698