| Index: trunk/src/components/sync_driver/ui_data_type_controller.cc
|
| ===================================================================
|
| --- trunk/src/components/sync_driver/ui_data_type_controller.cc (revision 289352)
|
| +++ trunk/src/components/sync_driver/ui_data_type_controller.cc (working copy)
|
| @@ -145,6 +145,11 @@
|
| }
|
|
|
| if (!shared_change_processor_->CryptoReadyIfNecessary()) {
|
| + syncer::SyncError error(FROM_HERE,
|
| + syncer::SyncError::CRYPTO_ERROR,
|
| + "",
|
| + type());
|
| + local_merge_result.set_error(error);
|
| StartDone(NEEDS_CRYPTO,
|
| local_merge_result,
|
| syncer_merge_result);
|
| @@ -237,7 +242,7 @@
|
| }
|
|
|
| void UIDataTypeController::StartDone(
|
| - StartResult start_result,
|
| + ConfigureResult start_result,
|
| const syncer::SyncMergeResult& local_merge_result,
|
| const syncer::SyncMergeResult& syncer_merge_result) {
|
| DCHECK(ui_thread_->BelongsToCurrentThread());
|
| @@ -257,12 +262,7 @@
|
| }
|
| }
|
|
|
| - // We have to release the callback before we call it, since it's possible
|
| - // invoking the callback will trigger a call to Stop(), which will get
|
| - // confused by the non-NULL start_callback_.
|
| - StartCallback callback = start_callback_;
|
| - start_callback_.Reset();
|
| - callback.Run(start_result, local_merge_result, syncer_merge_result);
|
| + start_callback_.Run(start_result, local_merge_result, syncer_merge_result);
|
| }
|
|
|
| void UIDataTypeController::Stop() {
|
| @@ -285,7 +285,6 @@
|
| // still in MODEL_STARTING.
|
| return;
|
| }
|
| - DCHECK(start_callback_.is_null());
|
|
|
| StopModels();
|
|
|
| @@ -327,8 +326,15 @@
|
| // TODO(tim): We double-upload some errors. See bug 383480.
|
| if (!error_callback_.is_null())
|
| error_callback_.Run();
|
| - if (!disable_callback().is_null())
|
| - disable_callback().Run(from_here, message);
|
| + if (!start_callback_.is_null()) {
|
| + syncer::SyncError error(
|
| + from_here, syncer::SyncError::DATATYPE_ERROR, message, type());
|
| + syncer::SyncMergeResult local_merge_result(type());
|
| + local_merge_result.set_error(error);
|
| + start_callback_.Run(RUNTIME_ERROR,
|
| + local_merge_result,
|
| + syncer::SyncMergeResult(type()));
|
| + }
|
| }
|
|
|
| void UIDataTypeController::RecordAssociationTime(base::TimeDelta time) {
|
| @@ -339,7 +345,7 @@
|
| #undef PER_DATA_TYPE_MACRO
|
| }
|
|
|
| -void UIDataTypeController::RecordStartFailure(StartResult result) {
|
| +void UIDataTypeController::RecordStartFailure(ConfigureResult result) {
|
| DCHECK(ui_thread_->BelongsToCurrentThread());
|
| UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeStartFailures",
|
| ModelTypeToHistogramInt(type()),
|
|
|