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

Unified Diff: trunk/src/chrome/browser/sync/profile_sync_service.cc

Issue 468643002: Revert 288464 "[Sync] Cleanup datatype configuration error handl..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: 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: trunk/src/chrome/browser/sync/profile_sync_service.cc
===================================================================
--- trunk/src/chrome/browser/sync/profile_sync_service.cc (revision 289114)
+++ trunk/src/chrome/browser/sync/profile_sync_service.cc (working copy)
@@ -1470,7 +1470,8 @@
configure_status_ = result.status;
if (backend_mode_ != SYNC) {
- if (configure_status_ == DataTypeManager::OK) {
+ if (configure_status_ == DataTypeManager::OK ||
+ configure_status_ == DataTypeManager::PARTIAL_SUCCESS) {
StartSyncingWithServer();
} else if (!expect_sync_configuration_aborted_) {
DVLOG(1) << "Backup/rollback backend failed to configure.";
@@ -1481,7 +1482,8 @@
}
if (!sync_configure_start_time_.is_null()) {
- if (result.status == DataTypeManager::OK) {
+ if (result.status == DataTypeManager::OK ||
+ result.status == DataTypeManager::PARTIAL_SUCCESS) {
base::Time sync_configure_stop_time = base::Time::Now();
base::TimeDelta delta = sync_configure_stop_time -
sync_configure_start_time_;
@@ -1505,7 +1507,8 @@
// The possible status values:
// ABORT - Configuration was aborted. This is not an error, if
// initiated by user.
- // OK - Some or all types succeeded.
+ // OK - Everything succeeded.
+ // PARTIAL_SUCCESS - Some datatypes failed to start.
// Everything else is an UnrecoverableError. So treat it as such.
// First handle the abort case.
@@ -1517,18 +1520,18 @@
}
// Handle unrecoverable error.
- if (configure_status_ != DataTypeManager::OK) {
+ if (configure_status_ != DataTypeManager::OK &&
+ configure_status_ != DataTypeManager::PARTIAL_SUCCESS) {
// Something catastrophic had happened. We should only have one
// error representing it.
- syncer::SyncError error =
- failed_data_types_handler_.GetUnrecoverableError();
+ DCHECK_EQ(result.failed_data_types.size(),
+ static_cast<unsigned int>(1));
+ syncer::SyncError error = result.failed_data_types.begin()->second;
DCHECK(error.IsSet());
std::string message =
"Sync configuration failed with status " +
DataTypeManager::ConfigureStatusToString(configure_status_) +
- " caused by " +
- syncer::ModelTypeSetToString(
- failed_data_types_handler_.GetUnrecoverableErrorTypes()) +
+ " during " + syncer::ModelTypeToString(error.model_type()) +
": " + error.message();
LOG(ERROR) << "ProfileSyncService error: " << message;
OnInternalUnrecoverableError(error.location(),

Powered by Google App Engine
This is Rietveld 408576698