summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/test
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-22 17:10:37 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-22 17:10:37 +0000
commit15fe32703792bb7af62f96ec9d2aeb9df4bdacc1 (patch)
tree12847c614dd6a33ff2f076fcaa571b8fc06a29b4 /sync/internal_api/test
parent438dfd74d0659796e1521f70490743ce0b021f1f (diff)
downloadchromium_src-15fe32703792bb7af62f96ec9d2aeb9df4bdacc1.zip
chromium_src-15fe32703792bb7af62f96ec9d2aeb9df4bdacc1.tar.gz
chromium_src-15fe32703792bb7af62f96ec9d2aeb9df4bdacc1.tar.bz2
[Sync] Have SBH tell SyncManager which types to purge
The SBH now specifies as part of the ConfigureSyncer call which types need to be purged. This is determined by whether this is a control types config (in which case all disabled types are purged) or whether any types have been disabled since the last configuration (as determined by the SBR). BUG=247115 Review URL: https://chromiumcodereview.appspot.com/17552014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208074 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/test')
-rw-r--r--sync/internal_api/test/fake_sync_manager.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/sync/internal_api/test/fake_sync_manager.cc b/sync/internal_api/test/fake_sync_manager.cc
index 036376f..3a9beca 100644
--- a/sync/internal_api/test/fake_sync_manager.cc
+++ b/sync/internal_api/test/fake_sync_manager.cc
@@ -194,27 +194,24 @@ void FakeSyncManager::StartSyncingNormally(
void FakeSyncManager::ConfigureSyncer(
ConfigureReason reason,
ModelTypeSet to_download,
+ ModelTypeSet to_purge,
ModelTypeSet to_journal,
ModelTypeSet to_unapply,
- ModelTypeSet to_ignore,
const ModelSafeRoutingInfo& new_routing_info,
const base::Closure& ready_task,
const base::Closure& retry_task) {
last_configure_reason_ = reason;
ModelTypeSet enabled_types = GetRoutingInfoTypes(new_routing_info);
- ModelTypeSet disabled_types = Difference(
- ModelTypeSet::All(), enabled_types);
- disabled_types.RemoveAll(to_ignore);
ModelTypeSet success_types = to_download;
success_types.RemoveAll(configure_fail_types_);
DVLOG(1) << "Faking configuration. Downloading: "
<< ModelTypeSetToString(success_types) << ". Cleaning: "
- << ModelTypeSetToString(disabled_types);
+ << ModelTypeSetToString(to_purge);
// Update our fake directory by clearing and fake-downloading as necessary.
UserShare* share = GetUserShare();
- share->directory->PurgeEntriesWithTypeIn(disabled_types,
+ share->directory->PurgeEntriesWithTypeIn(to_purge,
to_journal,
to_unapply);
for (ModelTypeSet::Iterator it = success_types.First(); it.Good(); it.Inc()) {
@@ -228,9 +225,9 @@ void FakeSyncManager::ConfigureSyncer(
// TODO(sync): consider only cleaning those types that were recently disabled,
// if this isn't the first cleanup, which more accurately reflects the
// behavior of the real cleanup logic.
- initial_sync_ended_types_.RemoveAll(disabled_types);
- progress_marker_types_.RemoveAll(disabled_types);
- cleaned_types_.PutAll(disabled_types);
+ initial_sync_ended_types_.RemoveAll(to_purge);
+ progress_marker_types_.RemoveAll(to_purge);
+ cleaned_types_.PutAll(to_purge);
// Now simulate the actual configuration for those types that successfully
// download + apply.