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 e8785540b6a47ef3a10edc16b1fb3ac89138d725..08e69894c0d9cc343ca3082e626c8f7437e3e33c 100644 |
--- a/chrome/browser/sync/glue/sync_backend_host.h |
+++ b/chrome/browser/sync/glue/sync_backend_host.h |
@@ -225,16 +225,12 @@ class SyncBackendHost : public BackendDataTypeConfigurer { |
// set of all types that failed configuration (i.e., if its argument |
// is non-empty, then an error was encountered). |
virtual void ConfigureDataTypes( |
- sync_api::ConfigureReason reason, |
- syncable::ModelTypeSet types_to_add, |
- syncable::ModelTypeSet types_to_remove, |
+ const sync_api::ConfigureReason& reason, |
+ const syncable::ModelTypeSet& desired_types, |
+ const syncable::ModelTypeSet& disabled_types, |
NigoriState nigori_state, |
- base::Callback<void(syncable::ModelTypeSet)> ready_task, |
- base::Callback<void()> retry_callback) OVERRIDE; |
- |
- // Makes an asynchronous call to syncer to switch to config mode. When done |
- // syncer will call us back on FinishConfigureDataTypes. |
- virtual void StartConfiguration(const base::Closure& callback); |
+ const base::Callback<void(syncable::ModelTypeSet)>& ready_task, |
+ const base::Callback<void()>& retry_callback) OVERRIDE; |
// Turns on encryption of all present and future sync data. |
virtual void EnableEncryptEverything(); |
@@ -338,9 +334,26 @@ class SyncBackendHost : public BackendDataTypeConfigurer { |
void HandleSyncCycleCompletedOnFrontendLoop( |
const sessions::SyncSessionSnapshot& snapshot); |
- // Called to finish the job of ConfigureDataTypes once the syncer is in |
- // configuration mode. |
- void FinishConfigureDataTypesOnFrontendLoop(); |
+ // Request the syncer to reconfigure with the specfied params. |
+ // Virtual for testing. |
+ virtual void RequestConfigureSyncer( |
+ sync_api::ConfigureReason reason, |
+ syncable::ModelTypeSet types_to_config, |
+ const browser_sync::ModelSafeRoutingInfo routing_info, |
+ const base::Callback<void(syncable::ModelTypeSet)>& ready_task, |
+ const base::Closure& retry_callback); |
+ |
+ // Called when the syncer has finished performing a configuration. |
+ void FinishConfigureDataTypesOnFrontendLoop( |
+ const syncable::ModelTypeSet& types_to_configure, |
+ const syncable::ModelTypeSet& configured_types, |
+ const base::Callback<void(syncable::ModelTypeSet)>& ready_task); |
+ |
+ // Called when the syncer failed to perform a configuration and will |
+ // eventually retry. FinishingConfigurationOnFrontendLoop(..) will be called |
+ // on successful completion. |
+ void RetryConfigurationOnFrontendLoop( |
+ const base::Closure& retry_callback); |
bool IsDownloadingNigoriForTest() const; |
@@ -365,32 +378,6 @@ class SyncBackendHost : public BackendDataTypeConfigurer { |
INITIALIZED, // Initialization is complete. |
}; |
- struct PendingConfigureDataTypesState { |
- PendingConfigureDataTypesState(); |
- ~PendingConfigureDataTypesState(); |
- |
- // The ready_task will be run when configuration is done with the |
- // set of all types that failed configuration (i.e., if its |
- // 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; |
- |
- // 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 |
// (via the nigori node) and informs the frontend if that is the case. |
// Note: it is illegal to call this before the backend is initialized. |
@@ -509,9 +496,6 @@ class SyncBackendHost : public BackendDataTypeConfigurer { |
// The frontend which we serve (and are owned by). |
SyncFrontend* frontend_; |
- scoped_ptr<PendingConfigureDataTypesState> pending_download_state_; |
- scoped_ptr<PendingConfigureDataTypesState> pending_config_mode_state_; |
- |
// We cache the cryptographer's pending keys whenever NotifyPassphraseRequired |
// is called. This way, before the UI calls SetDecryptionPassphrase on the |
// syncer, it can avoid the overhead of an asynchronous decryption call and |