Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(823)

Unified Diff: components/sync/engine/fake_sync_manager.cc

Issue 2580033002: [Sync] Ensure that CONFIGURE_CLEAN types get unapplied before configuration (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/sync/engine/fake_sync_manager.cc
diff --git a/components/sync/engine/fake_sync_manager.cc b/components/sync/engine/fake_sync_manager.cc
index abda05adc620c9a587327c8a932cb51117f54378..ba72d2d3bc73140b091548f265b897f7f361d6f2 100644
--- a/components/sync/engine/fake_sync_manager.cc
+++ b/components/sync/engine/fake_sync_manager.cc
@@ -126,8 +126,11 @@ void FakeSyncManager::PurgeDisabledTypes(ModelTypeSet to_purge,
// behavior of the real cleanup logic.
GetUserShare()->directory->PurgeEntriesWithTypeIn(to_purge, to_journal,
to_unapply);
- initial_sync_ended_types_.RemoveAll(to_purge);
- progress_marker_types_.RemoveAll(to_purge);
+ // Types from |to_unapply| should retain their server data and progress
+ // markers.
+ ModelTypeSet purged_types = Difference(to_purge, to_unapply);
+ initial_sync_ended_types_.RemoveAll(purged_types);
+ progress_marker_types_.RemoveAll(purged_types);
cleaned_types_.PutAll(to_purge);
}

Powered by Google App Engine
This is Rietveld 408576698