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

Unified Diff: chrome/browser/sync/sessions/sync_session.cc

Issue 9158004: Detect sync server communication errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update for review comments Created 8 years, 11 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
« no previous file with comments | « chrome/browser/sync/sessions/sync_session.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/sessions/sync_session.cc
diff --git a/chrome/browser/sync/sessions/sync_session.cc b/chrome/browser/sync/sessions/sync_session.cc
index 064fef6744e9d753fbb4b2e58975646e16ab9190..79d576f3cdaeb5caa893058a42c1c4a45f1725eb 100644
--- a/chrome/browser/sync/sessions/sync_session.cc
+++ b/chrome/browser/sync/sessions/sync_session.cc
@@ -233,6 +233,26 @@ std::set<ModelSafeGroup>
return enabled_groups_with_verified_updates;
}
+namespace {
+// Return true if the command in question was attempted and did not complete
+// successfully.
+//
+bool IsError(SyncerError error) {
+ return error != UNSET && error != SYNCER_OK;
+}
+} // namespace
+
+bool SyncSession::Succeeded() const {
+ const bool download_updates_error =
+ IsError(status_controller_->error().last_download_updates_result);
+ const bool post_commit_error =
+ IsError(status_controller_->error().last_post_commit_result);
+ const bool process_commit_response_error =
+ IsError(status_controller_->error().last_process_commit_response_result);
+ return !download_updates_error
+ && !post_commit_error
+ && !process_commit_response_error;
+}
} // namespace sessions
} // namespace browser_sync
« no previous file with comments | « chrome/browser/sync/sessions/sync_session.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698