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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 | 375 |
376 timer_.Stop(); | 376 timer_.Stop(); |
377 | 377 |
378 // Treat any unfinished types as having errors. | 378 // Treat any unfinished types as having errors. |
379 desired_types_.RemoveAll(associating_types_); | 379 desired_types_.RemoveAll(associating_types_); |
380 for (DataTypeController::TypeMap::const_iterator it = controllers_->begin(); | 380 for (DataTypeController::TypeMap::const_iterator it = controllers_->begin(); |
381 it != controllers_->end(); ++it) { | 381 it != controllers_->end(); ++it) { |
382 DataTypeController* dtc = (*it).second.get(); | 382 DataTypeController* dtc = (*it).second.get(); |
383 if (associating_types_.Has(dtc->type()) && | 383 if (associating_types_.Has(dtc->type()) && |
384 dtc->state() != DataTypeController::NOT_RUNNING) { | 384 dtc->state() != DataTypeController::NOT_RUNNING) { |
| 385 // TODO(wychen): enum uma should be strongly typed. crbug.com/661401 |
385 UMA_HISTOGRAM_ENUMERATION("Sync.ConfigureFailed", | 386 UMA_HISTOGRAM_ENUMERATION("Sync.ConfigureFailed", |
386 ModelTypeToHistogramInt(dtc->type()), | 387 ModelTypeToHistogramInt(dtc->type()), |
387 MODEL_TYPE_COUNT); | 388 static_cast<int>(MODEL_TYPE_COUNT)); |
388 StopDatatype(SyncError(FROM_HERE, SyncError::DATATYPE_ERROR, | 389 StopDatatype(SyncError(FROM_HERE, SyncError::DATATYPE_ERROR, |
389 "Association timed out.", dtc->type()), | 390 "Association timed out.", dtc->type()), |
390 dtc); | 391 dtc); |
391 } | 392 } |
392 } | 393 } |
393 | 394 |
394 DataTypeManager::ConfigureResult result(configure_status_, requested_types_); | 395 DataTypeManager::ConfigureResult result(configure_status_, requested_types_); |
395 | 396 |
396 // Need to reset state before invoking delegate in order to avoid re-entrancy | 397 // Need to reset state before invoking delegate in order to avoid re-entrancy |
397 // issues (delegate may trigger a reconfiguration). | 398 // issues (delegate may trigger a reconfiguration). |
(...skipping 20 matching lines...) Expand all Loading... |
418 // At least one type is not ready. | 419 // At least one type is not ready. |
419 return; | 420 return; |
420 } | 421 } |
421 } | 422 } |
422 | 423 |
423 notified_about_ready_for_configure_ = true; | 424 notified_about_ready_for_configure_ = true; |
424 delegate_->OnAllDataTypesReadyForConfigure(); | 425 delegate_->OnAllDataTypesReadyForConfigure(); |
425 } | 426 } |
426 | 427 |
427 } // namespace syncer | 428 } // namespace syncer |
OLD | NEW |