| 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/model_association_manager.h" | 5 #include "components/sync/driver/model_association_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 configure_status_ = DataTypeManager::ABORTED; | 255 configure_status_ = DataTypeManager::ABORTED; |
| 256 DVLOG(1) << "ModelAssociationManager: Calling OnModelAssociationDone"; | 256 DVLOG(1) << "ModelAssociationManager: Calling OnModelAssociationDone"; |
| 257 ModelAssociationDone(IDLE); | 257 ModelAssociationDone(IDLE); |
| 258 } else { | 258 } else { |
| 259 DCHECK(associating_types_.Empty()); | 259 DCHECK(associating_types_.Empty()); |
| 260 DCHECK(requested_types_.Empty()); | 260 DCHECK(requested_types_.Empty()); |
| 261 state_ = IDLE; | 261 state_ = IDLE; |
| 262 } | 262 } |
| 263 } | 263 } |
| 264 | 264 |
| 265 void ModelAssociationManager::ModelLoadCallback(syncer::ModelType type, | 265 void ModelAssociationManager::ModelLoadCallback( |
| 266 syncer::SyncError error) { | 266 syncer::ModelType type, |
| 267 const syncer::SyncError& error) { |
| 267 DVLOG(1) << "ModelAssociationManager: ModelLoadCallback for " | 268 DVLOG(1) << "ModelAssociationManager: ModelLoadCallback for " |
| 268 << syncer::ModelTypeToString(type); | 269 << syncer::ModelTypeToString(type); |
| 269 | 270 |
| 270 if (error.IsSet()) { | 271 if (error.IsSet()) { |
| 271 syncer::SyncMergeResult local_merge_result(type); | 272 syncer::SyncMergeResult local_merge_result(type); |
| 272 local_merge_result.set_error(error); | 273 local_merge_result.set_error(error); |
| 273 TypeStartCallback(type, base::TimeTicks::Now(), | 274 TypeStartCallback(type, base::TimeTicks::Now(), |
| 274 DataTypeController::ASSOCIATION_FAILED, | 275 DataTypeController::ASSOCIATION_FAILED, |
| 275 local_merge_result, syncer::SyncMergeResult(type)); | 276 local_merge_result, syncer::SyncMergeResult(type)); |
| 276 return; | 277 return; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 // At least one type is not ready. | 418 // At least one type is not ready. |
| 418 return; | 419 return; |
| 419 } | 420 } |
| 420 } | 421 } |
| 421 | 422 |
| 422 notified_about_ready_for_configure_ = true; | 423 notified_about_ready_for_configure_ = true; |
| 423 delegate_->OnAllDataTypesReadyForConfigure(); | 424 delegate_->OnAllDataTypesReadyForConfigure(); |
| 424 } | 425 } |
| 425 | 426 |
| 426 } // namespace sync_driver | 427 } // namespace sync_driver |
| OLD | NEW |