diff options
author | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-13 20:02:39 +0000 |
---|---|---|
committer | oshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-13 20:03:51 +0000 |
commit | d245d35f9c694771f8c618e51999f64baa419628 (patch) | |
tree | d1664ed81001f885b0f1402e70615288530b30aa /components/sync_driver/ui_data_type_controller.cc | |
parent | 83ace11a5dc437373b64922eba77df845c0a8910 (diff) | |
download | chromium_src-d245d35f9c694771f8c618e51999f64baa419628.zip chromium_src-d245d35f9c694771f8c618e51999f64baa419628.tar.gz chromium_src-d245d35f9c694771f8c618e51999f64baa419628.tar.bz2 |
Revert 289113 "Revert 288557 "[Sync] Use OnSingleDataTypeUnrecov..."
> Revert 288557 "[Sync] Use OnSingleDataTypeUnrecoverableError for..."
>
> Reason for revert: see crbug.com/403098
>
> > [Sync] Use OnSingleDataTypeUnrecoverableError for all errors
> >
> > This removes the disable callback from all datatype controllers as well
> > as the DisableDataType method from the PSS, in favor of
> > OnSingleDataTypeUnrecoverable error (which now accepts a SyncError).
> >
> > BUG=368834,403098
> > TBR=bauerb@chromium.org
> >
> > Review URL: https://codereview.chromium.org/436733002
>
> TBR=zea@chromium.org
>
> Review URL: https://codereview.chromium.org/465113002
TBR=oshima@chromium.org
Review URL: https://codereview.chromium.org/469073002
Cr-Commit-Position: refs/heads/master@{#289356}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289356 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/sync_driver/ui_data_type_controller.cc')
-rw-r--r-- | components/sync_driver/ui_data_type_controller.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/components/sync_driver/ui_data_type_controller.cc b/components/sync_driver/ui_data_type_controller.cc index 3b7945c..eca5779 100644 --- a/components/sync_driver/ui_data_type_controller.cc +++ b/components/sync_driver/ui_data_type_controller.cc @@ -17,8 +17,7 @@ namespace sync_driver { 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() 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 @@ void UIDataTypeController::Stop() { DCHECK(ui_thread_->BelongsToCurrentThread()); DCHECK(syncer::IsRealDataType(type_)); + if (state_ == NOT_RUNNING) + return; + State prev_state = state_; state_ = STOPPING; @@ -318,8 +319,9 @@ DataTypeController::State UIDataTypeController::state() const { 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 @@ void UIDataTypeController::OnSingleDatatypeUnrecoverableError( 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, |