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

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

Issue 7453014: [Sync] Refactor sync datatype error handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 9 years, 5 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 e9625e600b6181c229db3e230f15b0aaf6de9330..c809cd30f49c1c1226bd79f0aeb012d84b8e081e 100644
--- a/chrome/browser/sync/profile_sync_service.cc
+++ b/chrome/browser/sync/profile_sync_service.cc
@@ -1263,13 +1263,12 @@ void ProfileSyncService::Observe(int type,
break;
}
case chrome::NOTIFICATION_SYNC_CONFIGURE_DONE: {
- DataTypeManager::ConfigureResultWithErrorLocation* result_with_location =
- Details<DataTypeManager::ConfigureResultWithErrorLocation>(
- details).ptr();
+ DataTypeManager::ConfigureResult* result =
+ Details<DataTypeManager::ConfigureResult>(details).ptr();
- DataTypeManager::ConfigureResult result = result_with_location->result;
- VLOG(1) << "PSS SYNC_CONFIGURE_DONE called with result: " << result;
- if (result == DataTypeManager::ABORTED &&
+ DataTypeManager::ConfigureStatus status = result->status;
+ VLOG(1) << "PSS SYNC_CONFIGURE_DONE called with status: " << status;
+ if (status == DataTypeManager::ABORTED &&
expect_sync_configuration_aborted_) {
VLOG(0) << "ProfileSyncService::Observe Sync Configure aborted";
expect_sync_configuration_aborted_ = false;
@@ -1277,11 +1276,14 @@ void ProfileSyncService::Observe(int type,
}
// Clear out the gaia password if it is already there.
gaia_password_ = std::string();
- if (result != DataTypeManager::OK) {
+ if (status != DataTypeManager::OK) {
VLOG(0) << "ProfileSyncService::Observe: Unrecoverable error detected";
- std::string message = StringPrintf("Sync Configuration failed with %d",
- result);
- OnUnrecoverableError(*(result_with_location->location), message);
+ std::string message =
akalin 2011/07/25 23:49:32 I get nervous with type-unsafe APIs like Stringpri
Nicolas Zea 2011/07/26 00:23:46 Style guide discourages streams when not used dire
+ StringPrintf(
+ "Sync Configuration failed while configuring %s with result %d",
+ syncable::ModelTypeSetToString(result->failed_types).c_str(),
+ status);
+ OnUnrecoverableError(result->location, message);
cached_passphrase_ = CachedPassphrase();
return;
}
« no previous file with comments | « chrome/browser/sync/glue/typed_url_model_associator.cc ('k') | chrome/browser/sync/profile_sync_service_bookmark_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698