Index: trunk/src/components/sync_driver/ui_data_type_controller.cc |
=================================================================== |
--- trunk/src/components/sync_driver/ui_data_type_controller.cc (revision 289354) |
+++ trunk/src/components/sync_driver/ui_data_type_controller.cc (working copy) |
@@ -17,8 +17,7 @@ |
UIDataTypeController::UIDataTypeController() |
: DataTypeController(base::MessageLoopProxy::current(), |
- base::Closure(), |
- DisableTypeCallback()), |
+ base::Closure()), |
sync_factory_(NULL), |
state_(NOT_RUNNING), |
type_(syncer::UNSPECIFIED) { |
@@ -27,10 +26,9 @@ |
UIDataTypeController::UIDataTypeController( |
scoped_refptr<base::MessageLoopProxy> ui_thread, |
const base::Closure& error_callback, |
- const DisableTypeCallback& disable_callback, |
syncer::ModelType type, |
SyncApiComponentFactory* sync_factory) |
- : DataTypeController(ui_thread, error_callback, disable_callback), |
+ : DataTypeController(ui_thread, error_callback), |
sync_factory_(sync_factory), |
state_(NOT_RUNNING), |
type_(type), |
@@ -269,6 +267,9 @@ |
DCHECK(ui_thread_->BelongsToCurrentThread()); |
DCHECK(syncer::IsRealDataType(type_)); |
+ if (state_ == NOT_RUNNING) |
+ return; |
+ |
State prev_state = state_; |
state_ = STOPPING; |
@@ -318,8 +319,9 @@ |
return state_; |
} |
-void UIDataTypeController::OnSingleDatatypeUnrecoverableError( |
- const tracked_objects::Location& from_here, const std::string& message) { |
+void UIDataTypeController::OnSingleDataTypeUnrecoverableError( |
+ const syncer::SyncError& error) { |
+ DCHECK_EQ(type(), error.model_type()); |
UMA_HISTOGRAM_ENUMERATION("Sync.DataTypeRunFailures", |
ModelTypeToHistogramInt(type()), |
syncer::MODEL_TYPE_COUNT); |
@@ -327,8 +329,6 @@ |
if (!error_callback_.is_null()) |
error_callback_.Run(); |
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, |