Chromium Code Reviews| 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 274 // that the requested types list includes at least one non-nigori type. It | 274 // that the requested types list includes at least one non-nigori type. It |
| 275 // will not send a MIGRATION_DONE response in that case. We still need to be | 275 // will not send a MIGRATION_DONE response in that case. We still need to be |
| 276 // careful to not send progress markers for non-nigori types, though. If a | 276 // careful to not send progress markers for non-nigori types, though. If a |
| 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( |
| 285 ModelTypeSet::All(), Difference(current_types, clean_first_types)); | |
|
Nicolas Zea
2016/12/16 22:08:42
I think it might be simpler to understand if we ju
pavely
2016/12/16 23:57:46
Done.
| |
| 285 ModelTypeSet inactive_types = | 286 ModelTypeSet inactive_types = |
| 286 GetDataTypesInState(CONFIGURE_INACTIVE, config_state_map); | 287 GetDataTypesInState(CONFIGURE_INACTIVE, config_state_map); |
| 287 types_to_purge.RemoveAll(inactive_types); | 288 types_to_purge.RemoveAll(inactive_types); |
| 288 types_to_purge.RemoveAll(unready_types); | 289 types_to_purge.RemoveAll(unready_types); |
| 289 | 290 |
| 290 // If a type has already been disabled and unapplied or journaled, it will | 291 // 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 | 292 // not be part of the |types_to_purge| set, and therefore does not need |
| 292 // to be acted on again. | 293 // to be acted on again. |
| 293 fatal_types.RetainAll(types_to_purge); | 294 fatal_types.RetainAll(types_to_purge); |
| 294 ModelTypeSet unapply_types = Union(crypto_types, clean_first_types); | 295 ModelTypeSet unapply_types = Union(crypto_types, clean_first_types); |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 695 const SyncManager::ClearServerDataCallback& frontend_callback) { | 696 const SyncManager::ClearServerDataCallback& frontend_callback) { |
| 696 DCHECK(thread_checker_.CalledOnValidThread()); | 697 DCHECK(thread_checker_.CalledOnValidThread()); |
| 697 frontend_callback.Run(); | 698 frontend_callback.Run(); |
| 698 } | 699 } |
| 699 | 700 |
| 700 } // namespace syncer | 701 } // namespace syncer |
| 701 | 702 |
| 702 #undef SDVLOG | 703 #undef SDVLOG |
| 703 | 704 |
| 704 #undef SLOG | 705 #undef SLOG |
| OLD | NEW |