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> { ...@@ -43,10 +43,8 @@ class DataTypeController : public base::SupportsWeakPtr<DataTypeController> {
// Returned from RegisterWithBackend. // Returned from RegisterWithBackend.
enum RegisterWithBackendResult { enum RegisterWithBackendResult {
// Used when RegisterWithBackend is called on an already-registered type. // Indicates that the initial download for this type is already complete, or
// TODO(crbug.com/647505): Get rid of this entry entirely if possible. // wasn't needed in the first place (e.g. for proxy types).
REGISTRATION_IGNORED,
// Indicates that the initial download for this type is already complete.
TYPE_ALREADY_DOWNLOADED, TYPE_ALREADY_DOWNLOADED,
// Indicates that the initial download for this type still needs to be done. // Indicates that the initial download for this type still needs to be done.
TYPE_NOT_YET_DOWNLOADED, TYPE_NOT_YET_DOWNLOADED,
......
...@@ -206,10 +206,11 @@ void DataTypeManagerImpl::RegisterTypesWithBackend() { ...@@ -206,10 +206,11 @@ void DataTypeManagerImpl::RegisterTypesWithBackend() {
// time. // time.
DCHECK(!data_type_status_table_.GetFailedTypes().Has(dtc->type())); DCHECK(!data_type_status_table_.GetFailedTypes().Has(dtc->type()));
switch (dtc->RegisterWithBackend(configurer_)) { switch (dtc->RegisterWithBackend(configurer_)) {
case DataTypeController::REGISTRATION_IGNORED:
break;
case DataTypeController::TYPE_ALREADY_DOWNLOADED: 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; break;
case DataTypeController::TYPE_NOT_YET_DOWNLOADED: case DataTypeController::TYPE_NOT_YET_DOWNLOADED:
downloaded_types_.Remove(type); downloaded_types_.Remove(type);
......
...@@ -45,7 +45,8 @@ ProxyTabsDataTypeController::RegisterWithBackend( ...@@ -45,7 +45,8 @@ ProxyTabsDataTypeController::RegisterWithBackend(
state_ = RUNNING; state_ = RUNNING;
state_changed_cb_.Run(state_); 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, 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