Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3197)

Unified Diff: chrome/browser/sync/glue/frontend_data_type_controller.cc

Issue 436733002: [Sync] Use OnSingleDataTypeUnrecoverableError for all errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More cleanup Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/sync/glue/frontend_data_type_controller.cc
diff --git a/chrome/browser/sync/glue/frontend_data_type_controller.cc b/chrome/browser/sync/glue/frontend_data_type_controller.cc
index 38435a89e6eda14438c43c61be2d24ec7796a441..4cce7cbcc8b72dfced8b6502a95a642f21e92c41 100644
--- a/chrome/browser/sync/glue/frontend_data_type_controller.cc
+++ b/chrome/browser/sync/glue/frontend_data_type_controller.cc
@@ -30,7 +30,7 @@ FrontendDataTypeController::FrontendDataTypeController(
ProfileSyncComponentsFactory* profile_sync_factory,
Profile* profile,
ProfileSyncService* sync_service)
- : DataTypeController(ui_thread, error_callback, DisableTypeCallback()),
+ : DataTypeController(ui_thread, error_callback),
profile_sync_factory_(profile_sync_factory),
profile_(profile),
sync_service_(sync_service),
@@ -145,17 +145,21 @@ sync_driver::DataTypeController::State FrontendDataTypeController::state()
return state_;
}
-void FrontendDataTypeController::OnSingleDatatypeUnrecoverableError(
- const tracked_objects::Location& from_here, const std::string& message) {
- RecordUnrecoverableError(from_here, message);
- syncer::SyncError error(
- from_here, syncer::SyncError::DATATYPE_ERROR, message, type());
- sync_service_->DisableDatatype(error);
+void FrontendDataTypeController::OnSingleDataTypeUnrecoverableError(
+ const syncer::SyncError& error) {
+ DCHECK_EQ(type(), error.model_type());
+ RecordUnrecoverableError(error.location(), error.message());
+ if (!start_callback_.is_null()) {
haitaol1 2014/08/07 00:49:48 What happens if error happens after association?
Nicolas Zea 2014/08/07 18:14:54 The previous patch maade it so that the start call
haitaol1 2014/08/07 18:24:15 But on line 290 below, start_callback_ is reset.
Nicolas Zea 2014/08/07 22:50:19 Looks like I forgot to handle the legacy datatype
+ syncer::SyncMergeResult local_merge_result(type());
+ local_merge_result.set_error(error);
+ start_callback_.Run(RUNTIME_ERROR,
+ local_merge_result,
+ syncer::SyncMergeResult(type()));
+ }
}
FrontendDataTypeController::FrontendDataTypeController()
- : DataTypeController(base::MessageLoopProxy::current(), base::Closure(),
- DisableTypeCallback()),
+ : DataTypeController(base::MessageLoopProxy::current(), base::Closure()),
profile_sync_factory_(NULL),
profile_(NULL),
sync_service_(NULL),

Powered by Google App Engine
This is Rietveld 408576698