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

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

Issue 7861013: Fix the false-positive detection of commit errors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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/sessions/sync_session.cc
diff --git a/chrome/browser/sync/sessions/sync_session.cc b/chrome/browser/sync/sessions/sync_session.cc
index f399d7d7904ed1fee8a5425a8641cfaaab04675e..b210aed622ac680113e823669ca56d74607ff7af 100644
--- a/chrome/browser/sync/sessions/sync_session.cc
+++ b/chrome/browser/sync/sessions/sync_session.cc
@@ -141,7 +141,27 @@ bool SyncSession::HasMoreToSync() const {
status->conflicts_resolved();
// Or, we have conflicting updates, but we're making progress on
// resolving them...
- }
+}
+
+bool SyncSession::WasUnableToMakeProgress() const {
rlarocque 2011/09/20 20:10:03 This name sucks. I should call it WasAbleToMakePr
+ VLOG(1) << "Was unable to make progress?";
+ const StatusController* status = status_controller_.get();
+
+ // In the future, we should be able to report more about the cause of the
+ // errors and return an enum value. Right now that's not possible because
+ // our error detection is based on state that can tell us only that an
+ // error exists, but not much else.
+
+ // We were unable to download all updates, for some unknown reason
tim (not reviewing) 2011/09/20 16:21:57 style nit - end comments with periods
+ if (status->num_server_changes_remaining() > 0)
+ return true;
+
+ // Lots of errors could cause this
+ if (status->error().consecutive_errors > 0)
tim (not reviewing) 2011/09/20 16:21:57 Are all these errors "all or nothing"? I'm wonder
rlarocque 2011/09/20 20:10:03 In the future, I was hoping we could replace this
+ return true;
+
+ return false;
+}
} // namespace sessions
} // namespace browser_sync

Powered by Google App Engine
This is Rietveld 408576698