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

Side by Side Diff: components/sync/driver/glue/sync_backend_host_impl.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 unified diff | Download patch
« no previous file with comments | « no previous file | components/sync/driver/glue/sync_backend_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/sync/driver/glue/sync_backend_host_impl.h" 5 #include "components/sync/driver/glue/sync_backend_host_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 // non-nigori type in the request requires migration, a MIGRATION_DONE 277 // non-nigori type in the request requires migration, a MIGRATION_DONE
278 // response will be sent. 278 // response will be sent.
279 279
280 ModelSafeRoutingInfo routing_info; 280 ModelSafeRoutingInfo routing_info;
281 registrar_->GetModelSafeRoutingInfo(&routing_info); 281 registrar_->GetModelSafeRoutingInfo(&routing_info);
282 282
283 ModelTypeSet current_types = registrar_->GetLastConfiguredTypes(); 283 ModelTypeSet current_types = registrar_->GetLastConfiguredTypes();
284 ModelTypeSet types_to_purge = Difference(ModelTypeSet::All(), current_types); 284 ModelTypeSet types_to_purge = Difference(ModelTypeSet::All(), current_types);
285 ModelTypeSet inactive_types = 285 ModelTypeSet inactive_types =
286 GetDataTypesInState(CONFIGURE_INACTIVE, config_state_map); 286 GetDataTypesInState(CONFIGURE_INACTIVE, config_state_map);
287 // Include clean_first_types in types_to_purge, they are part of
288 // current_types, but still need to be cleared.
289 DCHECK(current_types.HasAll(clean_first_types));
290 types_to_purge.PutAll(clean_first_types);
287 types_to_purge.RemoveAll(inactive_types); 291 types_to_purge.RemoveAll(inactive_types);
288 types_to_purge.RemoveAll(unready_types); 292 types_to_purge.RemoveAll(unready_types);
289 293
290 // If a type has already been disabled and unapplied or journaled, it will 294 // If a type has already been disabled and unapplied or journaled, it will
291 // not be part of the |types_to_purge| set, and therefore does not need 295 // not be part of the |types_to_purge| set, and therefore does not need
292 // to be acted on again. 296 // to be acted on again.
293 fatal_types.RetainAll(types_to_purge); 297 fatal_types.RetainAll(types_to_purge);
294 ModelTypeSet unapply_types = Union(crypto_types, clean_first_types); 298 ModelTypeSet unapply_types = Union(crypto_types, clean_first_types);
295 unapply_types.RetainAll(types_to_purge); 299 unapply_types.RetainAll(types_to_purge);
296 300
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 const SyncManager::ClearServerDataCallback& frontend_callback) { 699 const SyncManager::ClearServerDataCallback& frontend_callback) {
696 DCHECK(thread_checker_.CalledOnValidThread()); 700 DCHECK(thread_checker_.CalledOnValidThread());
697 frontend_callback.Run(); 701 frontend_callback.Run();
698 } 702 }
699 703
700 } // namespace syncer 704 } // namespace syncer
701 705
702 #undef SDVLOG 706 #undef SDVLOG
703 707
704 #undef SLOG 708 #undef SLOG
OLDNEW
« no previous file with comments | « no previous file | components/sync/driver/glue/sync_backend_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698