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

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

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

Powered by Google App Engine
This is Rietveld 408576698