| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |