| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/data_type_manager_impl.h" | 5 #include "components/sync/driver/data_type_manager_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 | 198 |
| 199 DataTypeManagerImpl::DataTypeConfigStateMap | 199 DataTypeManagerImpl::DataTypeConfigStateMap |
| 200 DataTypeManagerImpl::BuildDataTypeConfigStateMap( | 200 DataTypeManagerImpl::BuildDataTypeConfigStateMap( |
| 201 const ModelTypeSet& types_being_configured) const { | 201 const ModelTypeSet& types_being_configured) const { |
| 202 // 1. Get the failed types (due to fatal, crypto, and unready errors). | 202 // 1. Get the failed types (due to fatal, crypto, and unready errors). |
| 203 // 2. Add the difference between last_requested_types_ and the failed types | 203 // 2. Add the difference between last_requested_types_ and the failed types |
| 204 // as CONFIGURE_INACTIVE. | 204 // as CONFIGURE_INACTIVE. |
| 205 // 3. Flip |types_being_configured| to CONFIGURE_ACTIVE. | 205 // 3. Flip |types_being_configured| to CONFIGURE_ACTIVE. |
| 206 // 4. Set non-enabled user types as DISABLED. | 206 // 4. Set non-enabled user types as DISABLED. |
| 207 // 5. Set the fatal, crypto, and unready types to their respective states. | 207 // 5. Set the fatal, crypto, and unready types to their respective states. |
| 208 ModelTypeSet error_types = data_type_status_table_.GetFailedTypes(); | |
| 209 ModelTypeSet fatal_types = data_type_status_table_.GetFatalErrorTypes(); | 208 ModelTypeSet fatal_types = data_type_status_table_.GetFatalErrorTypes(); |
| 210 ModelTypeSet crypto_types = data_type_status_table_.GetCryptoErrorTypes(); | 209 ModelTypeSet crypto_types = data_type_status_table_.GetCryptoErrorTypes(); |
| 211 ModelTypeSet unready_types = data_type_status_table_.GetUnreadyErrorTypes(); | 210 ModelTypeSet unready_types = data_type_status_table_.GetUnreadyErrorTypes(); |
| 212 | 211 |
| 213 // Types with persistence errors are only purged/resynced when they're | 212 // Types with persistence errors are only purged/resynced when they're |
| 214 // actively being configured. | 213 // actively being configured. |
| 215 ModelTypeSet clean_types = data_type_status_table_.GetPersistenceErrorTypes(); | 214 ModelTypeSet clean_types = data_type_status_table_.GetPersistenceErrorTypes(); |
| 216 clean_types.RetainAll(types_being_configured); | 215 clean_types.RetainAll(types_being_configured); |
| 217 | 216 |
| 218 // Types with unready errors do not count as unready if they've been disabled. | 217 // Types with unready errors do not count as unready if they've been disabled. |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 | 859 |
| 861 void DataTypeManagerImpl::SetTypeDownloaded(ModelType type, bool downloaded) { | 860 void DataTypeManagerImpl::SetTypeDownloaded(ModelType type, bool downloaded) { |
| 862 if (downloaded) { | 861 if (downloaded) { |
| 863 downloaded_types_.Put(type); | 862 downloaded_types_.Put(type); |
| 864 } else { | 863 } else { |
| 865 downloaded_types_.Remove(type); | 864 downloaded_types_.Remove(type); |
| 866 } | 865 } |
| 867 } | 866 } |
| 868 | 867 |
| 869 } // namespace syncer | 868 } // namespace syncer |
| OLD | NEW |