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

Unified Diff: chrome/browser/sync/glue/sync_backend_host.h

Issue 9235040: [Sync] Handle errors during first sync gracefully. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for review. 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
Index: chrome/browser/sync/glue/sync_backend_host.h
diff --git a/chrome/browser/sync/glue/sync_backend_host.h b/chrome/browser/sync/glue/sync_backend_host.h
index 710c0791de37ba63d9c2d40f113829a1bf21a5e5..1fd547ddbba58f8de39bf031c72abf0dbcfb0f90 100644
--- a/chrome/browser/sync/glue/sync_backend_host.h
+++ b/chrome/browser/sync/glue/sync_backend_host.h
@@ -64,6 +64,10 @@ class SyncFrontend {
// The backend queried the server recently and received some updates.
virtual void OnSyncCycleCompleted() = 0;
+ // Configure ran into some kind of error. But it is scheduled to be
+ // retried.
+ virtual void OnSyncConfigureRetry() = 0;
+
// The backend encountered an authentication problem and requests new
// credentials to be provided. See SyncBackendHost::Authenticate for details.
virtual void OnAuthError() = 0;
@@ -200,6 +204,7 @@ class SyncBackendHost {
syncable::ModelTypeSet types_to_remove,
sync_api::ConfigureReason reason,
base::Callback<void(syncable::ModelTypeSet)> ready_task,
+ base::Callback<void()> retry_callback,
bool enable_nigori);
// Makes an asynchronous call to syncer to switch to config mode. When done
@@ -336,6 +341,13 @@ class SyncBackendHost {
// argument is non-empty, then an error was encountered).
base::Callback<void(syncable::ModelTypeSet)> ready_task;
+ // The retry callback will be run when the download failed due to a
+ // transient error. This is to notify DTM so it can apropriately inform
+ // the UI. Note: The retry_callback will be run only once and after
+ // that we will not notify DTM until the sync is successful or in a
+ // permanent error state.
+ base::Callback<void()> retry_callback;
+
// The set of types that we are waiting to be initially synced in a
// configuration cycle.
syncable::ModelTypeSet types_to_add;
@@ -343,6 +355,7 @@ class SyncBackendHost {
// Additional details about which types were added.
syncable::ModelTypeSet added_types;
sync_api::ConfigureReason reason;
+ bool retry_in_progress;
};
// Checks if we have received a notice to turn on experimental datatypes
@@ -350,6 +363,9 @@ class SyncBackendHost {
// Note: it is illegal to call this before the backend is initialized.
void AddExperimentalTypes();
+ // Downloading of nigori failed and will be retried.
+ virtual void OnNigoriDownloadRetry();
+
// InitializationComplete passes through the SyncBackendHost to forward
// on to |frontend_|, and so that tests can intercept here if they need to
// set up initial conditions.

Powered by Google App Engine
This is Rietveld 408576698