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

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: Don't treat MIGRATION_DONE as an error 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..c105ed8cb3e2aea8451888c24a69e345912afc8d 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::ExperiencedTransientError() const {
+ 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.
+ if (status->num_server_changes_remaining() > 0)
+ return true;
+
+ // Lots of errors could cause this. It is believed all of them are
+ // transient.
tim (not reviewing) 2011/09/27 21:20:07 Hm. Don't we increment this for a number of error
rlarocque 2011/09/27 23:42:41 Maybe so. I haven't tracked down all the cases th
+ if (status->error().consecutive_errors > 0)
+ return true;
+
+ return false;
+}
} // namespace sessions
} // namespace browser_sync

Powered by Google App Engine
This is Rietveld 408576698