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

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

Issue 2580033002: [Sync] Ensure that CONFIGURE_CLEAN types get unapplied before configuration (Closed)
Patch Set: Adjusted comment 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
« no previous file with comments | « components/sync/engine/fake_sync_manager.h ('k') | components/sync/test/engine/test_syncable_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b97e933697889d95df158e4eca59f8539feb91b0 100644
--- a/components/sync/engine/fake_sync_manager.cc
+++ b/components/sync/engine/fake_sync_manager.cc
@@ -39,10 +39,16 @@ FakeSyncManager::FakeSyncManager(ModelTypeSet initial_sync_ended_types,
FakeSyncManager::~FakeSyncManager() {}
-ModelTypeSet FakeSyncManager::GetAndResetCleanedTypes() {
- ModelTypeSet cleaned_types = cleaned_types_;
- cleaned_types_.Clear();
- return cleaned_types;
+ModelTypeSet FakeSyncManager::GetAndResetPurgedTypes() {
+ ModelTypeSet purged_types = purged_types_;
+ purged_types_.Clear();
+ return purged_types;
+}
+
+ModelTypeSet FakeSyncManager::GetAndResetUnappliedTypes() {
+ ModelTypeSet unapplied_types = unapplied_types_;
+ unapplied_types_.Clear();
+ return unapplied_types;
}
ModelTypeSet FakeSyncManager::GetAndResetDownloadedTypes() {
@@ -114,7 +120,7 @@ void FakeSyncManager::PurgePartiallySyncedTypes() {
partial_types.Put(i.Get());
}
progress_marker_types_.RemoveAll(partial_types);
- cleaned_types_.PutAll(partial_types);
+ purged_types_.PutAll(partial_types);
}
void FakeSyncManager::PurgeDisabledTypes(ModelTypeSet to_purge,
@@ -126,9 +132,12 @@ 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);
- cleaned_types_.PutAll(to_purge);
+ purged_types_.PutAll(to_purge);
+ unapplied_types_.PutAll(to_unapply);
+ // Types from |to_unapply| should retain their server data and progress
+ // markers.
+ initial_sync_ended_types_.RemoveAll(Difference(to_purge, to_unapply));
+ progress_marker_types_.RemoveAll(Difference(to_purge, to_unapply));
}
void FakeSyncManager::UpdateCredentials(const SyncCredentials& credentials) {
« no previous file with comments | « components/sync/engine/fake_sync_manager.h ('k') | components/sync/test/engine/test_syncable_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698