| Index: chrome/browser/sync/glue/sync_backend_host.cc
|
| diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc
|
| index 7fd2164d9b97a6ca443359bcad3a09c500da5880..4c8b2c1a7b7ce0eb0dab225b7e14e808211af9de 100644
|
| --- a/chrome/browser/sync/glue/sync_backend_host.cc
|
| +++ b/chrome/browser/sync/glue/sync_backend_host.cc
|
| @@ -85,9 +85,9 @@ struct DoConfigureSyncerTypes {
|
| DoConfigureSyncerTypes() {}
|
| ~DoConfigureSyncerTypes() {}
|
| syncer::ModelTypeSet to_download;
|
| + syncer::ModelTypeSet to_purge;
|
| syncer::ModelTypeSet to_journal;
|
| syncer::ModelTypeSet to_unapply;
|
| - syncer::ModelTypeSet to_ignore;
|
| };
|
|
|
| } // namespace
|
| @@ -717,6 +717,8 @@ void SyncBackendHost::ConfigureDataTypes(
|
| // backend because configuration requests are never aborted; they are retried
|
| // until they succeed or the backend is shut down.
|
|
|
| + syncer::ModelTypeSet previous_types = registrar_->GetLastConfiguredTypes();
|
| +
|
| syncer::ModelTypeSet disabled_types =
|
| GetDataTypesInState(DISABLED, config_state_map);
|
| syncer::ModelTypeSet fatal_types =
|
| @@ -728,8 +730,6 @@ void SyncBackendHost::ConfigureDataTypes(
|
| syncer::ModelTypeSet types_to_download = registrar_->ConfigureDataTypes(
|
| GetDataTypesInState(CONFIGURE_ACTIVE, config_state_map),
|
| disabled_types);
|
| - syncer::ModelTypeSet inactive_types =
|
| - GetDataTypesInState(CONFIGURE_INACTIVE, config_state_map);
|
| types_to_download.RemoveAll(syncer::ProxyTypes());
|
| if (!types_to_download.Empty())
|
| types_to_download.Put(syncer::NIGORI);
|
| @@ -759,6 +759,17 @@ void SyncBackendHost::ConfigureDataTypes(
|
| syncer::ModelSafeRoutingInfo routing_info;
|
| registrar_->GetModelSafeRoutingInfo(&routing_info);
|
|
|
| + syncer::ModelTypeSet current_types = registrar_->GetLastConfiguredTypes();
|
| + syncer::ModelTypeSet types_to_purge =
|
| + syncer::Difference(previous_types, current_types);
|
| + syncer::ModelTypeSet inactive_types =
|
| + GetDataTypesInState(CONFIGURE_INACTIVE, config_state_map);
|
| + types_to_purge.RemoveAll(inactive_types);
|
| +
|
| + DCHECK(syncer::Intersection(current_types, fatal_types).Empty());
|
| + DCHECK(syncer::Intersection(current_types, crypto_types).Empty());
|
| + DCHECK(current_types.HasAll(types_to_download));
|
| +
|
| SDVLOG(1) << "Types "
|
| << syncer::ModelTypeSetToString(types_to_download)
|
| << " added; calling DoConfigureSyncer";
|
| @@ -776,6 +787,7 @@ void SyncBackendHost::ConfigureDataTypes(
|
| // touched.
|
| RequestConfigureSyncer(reason,
|
| types_to_download,
|
| + types_to_purge,
|
| fatal_types,
|
| crypto_types,
|
| inactive_types,
|
| @@ -859,6 +871,7 @@ void SyncBackendHost::InitCore(const DoInitializeOptions& options) {
|
| void SyncBackendHost::RequestConfigureSyncer(
|
| syncer::ConfigureReason reason,
|
| syncer::ModelTypeSet to_download,
|
| + syncer::ModelTypeSet to_purge,
|
| syncer::ModelTypeSet to_journal,
|
| syncer::ModelTypeSet to_unapply,
|
| syncer::ModelTypeSet to_ignore,
|
| @@ -868,9 +881,9 @@ void SyncBackendHost::RequestConfigureSyncer(
|
| const base::Closure& retry_callback) {
|
| DoConfigureSyncerTypes config_types;
|
| config_types.to_download = to_download;
|
| + config_types.to_purge = to_purge;
|
| config_types.to_journal = to_journal;
|
| config_types.to_unapply = to_unapply;
|
| - config_types.to_ignore = to_ignore;
|
| sync_thread_.message_loop()->PostTask(FROM_HERE,
|
| base::Bind(&SyncBackendHost::Core::DoConfigureSyncer,
|
| core_.get(),
|
| @@ -1028,10 +1041,14 @@ void SyncBackendHost::Core::DoDownloadControlTypes(
|
| << syncer::ModelTypeSetToString(new_control_types)
|
| << " added; calling ConfigureSyncer";
|
|
|
| + syncer::ModelTypeSet types_to_purge =
|
| + syncer::Difference(syncer::ModelTypeSet::All(),
|
| + GetRoutingInfoTypes(routing_info));
|
| +
|
| sync_manager_->ConfigureSyncer(
|
| reason,
|
| new_control_types,
|
| - syncer::ModelTypeSet(),
|
| + types_to_purge,
|
| syncer::ModelTypeSet(),
|
| syncer::ModelTypeSet(),
|
| routing_info,
|
| @@ -1451,9 +1468,9 @@ void SyncBackendHost::Core::DoConfigureSyncer(
|
| sync_manager_->ConfigureSyncer(
|
| reason,
|
| config_types.to_download,
|
| + config_types.to_purge,
|
| config_types.to_journal,
|
| config_types.to_unapply,
|
| - config_types.to_ignore,
|
| routing_info,
|
| base::Bind(&SyncBackendHost::Core::DoFinishConfigureDataTypes,
|
| this,
|
|
|