Commit 3110395e authored by gangwu's avatar gangwu Committed by Commit bot

[USS] Covert kSyncEnableUSSDeviceInfo commandline flag to Feature API

BUG=647492

Review-Url: https://codereview.chromium.org/2341923004
Cr-Commit-Position: refs/heads/master@{#419176}
parent a31fd0c0
...@@ -150,8 +150,7 @@ void ProfileSyncComponentsFactoryImpl::RegisterCommonDataTypes( ...@@ -150,8 +150,7 @@ void ProfileSyncComponentsFactoryImpl::RegisterCommonDataTypes(
base::Bind(&ChromeReportUnrecoverableError, channel_); base::Bind(&ChromeReportUnrecoverableError, channel_);
// TODO(stanisc): can DEVICE_INFO be one of disabled datatypes? // TODO(stanisc): can DEVICE_INFO be one of disabled datatypes?
if (channel_ == version_info::Channel::UNKNOWN && if (base::FeatureList::IsEnabled(switches::kSyncUSSDeviceInfo)) {
command_line_.HasSwitch(switches::kSyncEnableUSSDeviceInfo)) {
sync_service->RegisterDataTypeController( sync_service->RegisterDataTypeController(
base::MakeUnique<UIModelTypeController>(syncer::DEVICE_INFO, base::MakeUnique<UIModelTypeController>(syncer::DEVICE_INFO,
error_callback, sync_client_)); error_callback, sync_client_));
......
...@@ -294,9 +294,7 @@ void ProfileSyncService::Initialize() { ...@@ -294,9 +294,7 @@ void ProfileSyncService::Initialize() {
sync_enabled_weak_factory_.GetWeakPtr(), sync_enabled_weak_factory_.GetWeakPtr(),
syncer::ModelTypeSet(syncer::SESSIONS)))); syncer::ModelTypeSet(syncer::SESSIONS))));
if (channel_ == version_info::Channel::UNKNOWN && if (base::FeatureList::IsEnabled(switches::kSyncUSSDeviceInfo)) {
base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kSyncEnableUSSDeviceInfo)) {
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner( scoped_refptr<base::SequencedTaskRunner> blocking_task_runner(
blocking_pool_->GetSequencedTaskRunnerWithShutdownBehavior( blocking_pool_->GetSequencedTaskRunnerWithShutdownBehavior(
blocking_pool_->GetSequenceToken(), blocking_pool_->GetSequenceToken(),
......
...@@ -17,11 +17,6 @@ const char kSyncDisableDeferredStartup[] = "sync-disable-deferred-startup"; ...@@ -17,11 +17,6 @@ const char kSyncDisableDeferredStartup[] = "sync-disable-deferred-startup";
// Enables feature to avoid unnecessary GetUpdate requests. // Enables feature to avoid unnecessary GetUpdate requests.
const char kSyncEnableGetUpdateAvoidance[] = "sync-enable-get-update-avoidance"; const char kSyncEnableGetUpdateAvoidance[] = "sync-enable-get-update-avoidance";
// Enables USS implementation of DeviceInfo datatype. This flag controls whether
// SyncableService based or ModelTypeService based implementation is used for
// DeviceInfo type.
const char kSyncEnableUSSDeviceInfo[] = "sync-enable-uss-device-info";
// Overrides the default server used for profile sync. // Overrides the default server used for profile sync.
const char kSyncServiceURL[] = "sync-url"; const char kSyncServiceURL[] = "sync-url";
...@@ -34,4 +29,10 @@ const char kSyncShortInitialRetryOverride[] = ...@@ -34,4 +29,10 @@ const char kSyncShortInitialRetryOverride[] =
const base::Feature kSyncClearDataOnPassphraseEncryption{ const base::Feature kSyncClearDataOnPassphraseEncryption{
"ClearSyncDataOnPassphraseEncryption", base::FEATURE_DISABLED_BY_DEFAULT}; "ClearSyncDataOnPassphraseEncryption", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables USS implementation of DeviceInfo datatype. This flag controls whether
// SyncableService based or ModelTypeService based implementation is used for
// DeviceInfo type.
const base::Feature kSyncUSSDeviceInfo{"EnableSyncUSSDeviceInfo",
base::FEATURE_DISABLED_BY_DEFAULT};
} // namespace switches } // namespace switches
...@@ -16,11 +16,11 @@ namespace switches { ...@@ -16,11 +16,11 @@ namespace switches {
extern const char kSyncDeferredStartupTimeoutSeconds[]; extern const char kSyncDeferredStartupTimeoutSeconds[];
extern const char kSyncDisableDeferredStartup[]; extern const char kSyncDisableDeferredStartup[];
extern const char kSyncEnableGetUpdateAvoidance[]; extern const char kSyncEnableGetUpdateAvoidance[];
extern const char kSyncEnableUSSDeviceInfo[];
extern const char kSyncServiceURL[]; extern const char kSyncServiceURL[];
extern const char kSyncShortInitialRetryOverride[]; extern const char kSyncShortInitialRetryOverride[];
extern const base::Feature kSyncClearDataOnPassphraseEncryption; extern const base::Feature kSyncClearDataOnPassphraseEncryption;
extern const base::Feature kSyncUSSDeviceInfo;
} // namespace switches } // namespace switches
......
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