Commit fbf9d2ac authored by Mikel Astiz's avatar Mikel Astiz Committed by Commit Bot

Fix supervised user types starting in sync standalone transport

We've observed crash reports that may be related, but nevertheless
starting this feature during sync standalone transport is questionable.

We achieve so by removing SUPERVISED_USER types from "core" sync types
and instead considering them user types that always preferred (as long
as sync-the-feature is enabled) and of high priority (to avoid
behavioral differences wrt startup latency).

Together with ignoring two remaining deprecated types, "core" sync types
now become synonym of control types, so we get rid of the concept
altogether.

Bug: 923826
Change-Id: Ie653f1c43f892307d72655967d4d75f13c338741
Reviewed-on: https://chromium-review.googlesource.com/c/1454519Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Commit-Queue: Mikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#629113}
parent 707ebb06
...@@ -228,7 +228,8 @@ constexpr ModelTypeSet UserTypes() { ...@@ -228,7 +228,8 @@ constexpr ModelTypeSet UserTypes() {
// User types, which are not user-controlled. // User types, which are not user-controlled.
constexpr ModelTypeSet AlwaysPreferredUserTypes() { constexpr ModelTypeSet AlwaysPreferredUserTypes() {
return ModelTypeSet(DEVICE_INFO, USER_CONSENTS); return ModelTypeSet(DEVICE_INFO, USER_CONSENTS, SUPERVISED_USER_SETTINGS,
SUPERVISED_USER_WHITELISTS);
} }
// These are the user-selectable data types. // These are the user-selectable data types.
...@@ -248,7 +249,8 @@ constexpr bool IsUserSelectableType(ModelType model_type) { ...@@ -248,7 +249,8 @@ constexpr bool IsUserSelectableType(ModelType model_type) {
// This is the subset of UserTypes() that have priority over other types. These // This is the subset of UserTypes() that have priority over other types. These
// types are synced before other user types and are never encrypted. // types are synced before other user types and are never encrypted.
constexpr ModelTypeSet PriorityUserTypes() { constexpr ModelTypeSet PriorityUserTypes() {
return ModelTypeSet(DEVICE_INFO, PRIORITY_PREFERENCES); return ModelTypeSet(DEVICE_INFO, PRIORITY_PREFERENCES,
SUPERVISED_USER_SETTINGS, SUPERVISED_USER_WHITELISTS);
} }
// Proxy types are placeholder types for handling implicitly enabling real // Proxy types are placeholder types for handling implicitly enabling real
...@@ -280,20 +282,6 @@ constexpr bool IsControlType(ModelType model_type) { ...@@ -280,20 +282,6 @@ constexpr bool IsControlType(ModelType model_type) {
return ControlTypes().Has(model_type); return ControlTypes().Has(model_type);
} }
// Core types are those data types used by sync's core functionality (i.e. not
// user data types). These types are always enabled, and include ControlTypes().
//
// The set of all core types.
constexpr ModelTypeSet CoreTypes() {
return ModelTypeSet(NIGORI, EXPERIMENTS, SUPERVISED_USER_SETTINGS,
SYNCED_NOTIFICATIONS, SYNCED_NOTIFICATION_APP_INFO,
SUPERVISED_USER_WHITELISTS);
}
// Those core types that have high priority (includes ControlTypes()).
constexpr ModelTypeSet PriorityCoreTypes() {
return ModelTypeSet(NIGORI, EXPERIMENTS, SUPERVISED_USER_SETTINGS);
}
// Types that may commit data, but should never be included in a GetUpdates. // Types that may commit data, but should never be included in a GetUpdates.
constexpr ModelTypeSet CommitOnlyTypes() { constexpr ModelTypeSet CommitOnlyTypes() {
return ModelTypeSet(USER_EVENTS, USER_CONSENTS); return ModelTypeSet(USER_EVENTS, USER_CONSENTS);
......
...@@ -81,7 +81,7 @@ void DataTypeManagerImpl::Configure(ModelTypeSet desired_types, ...@@ -81,7 +81,7 @@ void DataTypeManagerImpl::Configure(ModelTypeSet desired_types,
if (context.reason == CONFIGURE_REASON_CATCH_UP) if (context.reason == CONFIGURE_REASON_CATCH_UP)
catch_up_in_progress_ = true; catch_up_in_progress_ = true;
desired_types.PutAll(CoreTypes()); desired_types.PutAll(ControlTypes());
ModelTypeSet allowed_types = ControlTypes(); ModelTypeSet allowed_types = ControlTypes();
// Add types with controllers. // Add types with controllers.
...@@ -343,7 +343,7 @@ void DataTypeManagerImpl::OnAllDataTypesReadyForConfigure() { ...@@ -343,7 +343,7 @@ void DataTypeManagerImpl::OnAllDataTypesReadyForConfigure() {
ModelTypeSet DataTypeManagerImpl::GetPriorityTypes() const { ModelTypeSet DataTypeManagerImpl::GetPriorityTypes() const {
ModelTypeSet high_priority_types; ModelTypeSet high_priority_types;
high_priority_types.PutAll(PriorityCoreTypes()); high_priority_types.PutAll(ControlTypes());
high_priority_types.PutAll(PriorityUserTypes()); high_priority_types.PutAll(PriorityUserTypes());
return high_priority_types; return high_priority_types;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment