Index: chrome/browser/sync/glue/non_frontend_data_type_controller.cc |
diff --git a/chrome/browser/sync/glue/non_frontend_data_type_controller.cc b/chrome/browser/sync/glue/non_frontend_data_type_controller.cc |
index 5b83a8e7d52e1cd5135baf1cf7c1f8d764b41859..857f878ac17cfbe48cd418ea51cc7716ba186275 100644 |
--- a/chrome/browser/sync/glue/non_frontend_data_type_controller.cc |
+++ b/chrome/browser/sync/glue/non_frontend_data_type_controller.cc |
@@ -157,16 +157,15 @@ NonFrontendDataTypeController::AssociationResult::AssociationResult( |
NonFrontendDataTypeController::AssociationResult::~AssociationResult() {} |
// TODO(tim): Legacy controllers are being left behind in componentization |
-// effort for now, hence passing null DisableTypeCallback and still having |
-// a dependency on ProfileSyncService. That dep can probably be removed |
-// without too much work. |
+// effort for now, hence still having a dependency on ProfileSyncService. |
+// That dep can probably be removed without too much work. |
NonFrontendDataTypeController::NonFrontendDataTypeController( |
scoped_refptr<base::MessageLoopProxy> ui_thread, |
const base::Closure& error_callback, |
ProfileSyncComponentsFactory* profile_sync_factory, |
Profile* profile, |
ProfileSyncService* sync_service) |
- : DataTypeController(ui_thread, error_callback, DisableTypeCallback()), |
+ : DataTypeController(ui_thread, error_callback), |
state_(NOT_RUNNING), |
profile_sync_factory_(profile_sync_factory), |
profile_(profile), |
@@ -297,21 +296,19 @@ sync_driver::DataTypeController::State NonFrontendDataTypeController::state() |
return state_; |
} |
-void NonFrontendDataTypeController::OnSingleDatatypeUnrecoverableError( |
- const tracked_objects::Location& from_here, |
- const std::string& message) { |
+void NonFrontendDataTypeController::OnSingleDataTypeUnrecoverableError( |
+ const syncer::SyncError& error) { |
DCHECK(IsOnBackendThread()); |
- RecordUnrecoverableError(from_here, message); |
- BrowserThread::PostTask(BrowserThread::UI, from_here, |
+ DCHECK_EQ(type(), error.model_type()); |
+ RecordUnrecoverableError(error.location(), error.message()); |
+ BrowserThread::PostTask(BrowserThread::UI, error.location(), |
base::Bind(&NonFrontendDataTypeController::DisableImpl, |
this, |
- from_here, |
- message)); |
+ error)); |
} |
NonFrontendDataTypeController::NonFrontendDataTypeController() |
- : DataTypeController(base::MessageLoopProxy::current(), base::Closure(), |
- DisableTypeCallback()), |
+ : DataTypeController(base::MessageLoopProxy::current(), base::Closure()), |
state_(NOT_RUNNING), |
profile_sync_factory_(NULL), |
profile_(NULL), |
@@ -381,12 +378,15 @@ void NonFrontendDataTypeController::StartDoneImpl( |
} |
void NonFrontendDataTypeController::DisableImpl( |
- const tracked_objects::Location& from_here, |
- const std::string& message) { |
+ const syncer::SyncError& error) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
- syncer::SyncError error( |
- from_here, syncer::SyncError::DATATYPE_ERROR, message, type()); |
- profile_sync_service_->DisableDatatype(error); |
+ if (!start_callback_.is_null()) { |
haitaol1
2014/08/07 00:49:48
What happens if error happens after association?
|
+ syncer::SyncMergeResult local_merge_result(type()); |
+ local_merge_result.set_error(error); |
+ start_callback_.Run(RUNTIME_ERROR, |
+ local_merge_result, |
+ syncer::SyncMergeResult(type())); |
+ } |
} |
void NonFrontendDataTypeController::RecordAssociationTime( |