Commit 35e29c7e authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

Sync cleanup: Remove DataTypeController::REGISTRATION_IGNORED

Contrary to the code comment, it was only used for the PROXY_TABS data
type. This is now handled explicitly instead.

Bug: 647505
Change-Id: I5fd3fdb4d93230acac32966c1ee54334983dc6b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2462093
Commit-Queue: Marc Treib <treib@chromium.org>
Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816148}
parent 8b2168ee
......@@ -43,10 +43,8 @@ class DataTypeController : public base::SupportsWeakPtr<DataTypeController> {
// Returned from RegisterWithBackend.
enum RegisterWithBackendResult {
// Used when RegisterWithBackend is called on an already-registered type.
// TODO(crbug.com/647505): Get rid of this entry entirely if possible.
REGISTRATION_IGNORED,
// Indicates that the initial download for this type is already complete.
// Indicates that the initial download for this type is already complete, or
// wasn't needed in the first place (e.g. for proxy types).
TYPE_ALREADY_DOWNLOADED,
// Indicates that the initial download for this type still needs to be done.
TYPE_NOT_YET_DOWNLOADED,
......
......@@ -206,10 +206,11 @@ void DataTypeManagerImpl::RegisterTypesWithBackend() {
// time.
DCHECK(!data_type_status_table_.GetFailedTypes().Has(dtc->type()));
switch (dtc->RegisterWithBackend(configurer_)) {
case DataTypeController::REGISTRATION_IGNORED:
break;
case DataTypeController::TYPE_ALREADY_DOWNLOADED:
downloaded_types_.Put(type);
// Proxy types (as opposed to protocol types) don't actually have any
// data, so keep proxy types out of |downloaded_types_|.
if (!IsProxyType(type))
downloaded_types_.Put(type);
break;
case DataTypeController::TYPE_NOT_YET_DOWNLOADED:
downloaded_types_.Remove(type);
......
......@@ -45,7 +45,8 @@ ProxyTabsDataTypeController::RegisterWithBackend(
state_ = RUNNING;
state_changed_cb_.Run(state_);
return REGISTRATION_IGNORED;
// Proxy types don't have any data to download.
return TYPE_ALREADY_DOWNLOADED;
}
void ProxyTabsDataTypeController::Stop(syncer::ShutdownReason shutdown_reason,
......
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