| 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.h" | 5 #include "components/sync_driver/data_type_manager.h" |
| 6 #include "components/sync_driver/failed_data_types_handler.h" | 6 #include "components/sync_driver/failed_data_types_handler.h" |
| 7 | 7 |
| 8 using browser_sync::DataTypeManager; | 8 namespace sync_driver { |
| 9 | |
| 10 namespace browser_sync { | |
| 11 | 9 |
| 12 namespace { | 10 namespace { |
| 13 | 11 |
| 14 syncer::ModelTypeSet GetTypesFromErrorMap( | 12 syncer::ModelTypeSet GetTypesFromErrorMap( |
| 15 const FailedDataTypesHandler::TypeErrorMap& errors) { | 13 const FailedDataTypesHandler::TypeErrorMap& errors) { |
| 16 syncer::ModelTypeSet result; | 14 syncer::ModelTypeSet result; |
| 17 for (FailedDataTypesHandler::TypeErrorMap::const_iterator it = errors.begin(); | 15 for (FailedDataTypesHandler::TypeErrorMap::const_iterator it = errors.begin(); |
| 18 it != errors.end(); ++it) { | 16 it != errors.end(); ++it) { |
| 19 DCHECK(!result.Has(it->first)); | 17 DCHECK(!result.Has(it->first)); |
| 20 result.Put(it->first); | 18 result.Put(it->first); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 129 } |
| 132 | 130 |
| 133 bool FailedDataTypesHandler::AnyFailedDataType() const { | 131 bool FailedDataTypesHandler::AnyFailedDataType() const { |
| 134 // Note: persistence errors are not failed types. They just trigger automatic | 132 // Note: persistence errors are not failed types. They just trigger automatic |
| 135 // unapply + getupdates, at which point they are associated like normal. | 133 // unapply + getupdates, at which point they are associated like normal. |
| 136 return !unrecoverable_errors_.empty() || | 134 return !unrecoverable_errors_.empty() || |
| 137 !data_type_errors_.empty() || | 135 !data_type_errors_.empty() || |
| 138 !crypto_errors_.empty(); | 136 !crypto_errors_.empty(); |
| 139 } | 137 } |
| 140 | 138 |
| 141 } // namespace browser_sync | 139 } // namespace sync_driver |
| OLD | NEW |