diff options
Diffstat (limited to 'chrome/browser/sync/glue')
-rw-r--r-- | chrome/browser/sync/glue/sync_backend_host.cc | 9 | ||||
-rw-r--r-- | chrome/browser/sync/glue/sync_backend_host.h | 7 |
2 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc index 15d78cf..73fee4d 100644 --- a/chrome/browser/sync/glue/sync_backend_host.cc +++ b/chrome/browser/sync/glue/sync_backend_host.cc @@ -592,6 +592,15 @@ void SyncBackendHost::Core::OnResumed() { NewRunnableMethod(this, &Core::NotifyResumed)); } +void SyncBackendHost::Core::OnStopSyncingPermanently() { + host_->frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(this, + &Core::HandleStopSyncingPermanentlyOnFrontendLoop)); +} + +void SyncBackendHost::Core::HandleStopSyncingPermanentlyOnFrontendLoop() { + host_->frontend_->OnStopSyncingPermanently(); +} + void SyncBackendHost::Core::HandleAuthErrorEventOnFrontendLoop( const GoogleServiceAuthError& new_auth_error) { if (!host_ || !host_->frontend_) diff --git a/chrome/browser/sync/glue/sync_backend_host.h b/chrome/browser/sync/glue/sync_backend_host.h index a91d877..41a388a 100644 --- a/chrome/browser/sync/glue/sync_backend_host.h +++ b/chrome/browser/sync/glue/sync_backend_host.h @@ -58,6 +58,10 @@ class SyncFrontend { // credentials to be provided. See SyncBackendHost::Authenticate for details. virtual void OnAuthError() = 0; + // We are no longer permitted to communicate with the server. Sync should + // be disabled and state cleaned up at once. + virtual void OnStopSyncingPermanently() = 0; + protected: // Don't delete through SyncFrontend interface. virtual ~SyncFrontend() { @@ -230,6 +234,7 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar { virtual void OnPassphraseAccepted(); virtual void OnPaused(); virtual void OnResumed(); + virtual void OnStopSyncingPermanently(); struct DoInitializeOptions { DoInitializeOptions( @@ -374,6 +379,8 @@ class SyncBackendHost : public browser_sync::ModelSafeWorkerRegistrar { void HandleSyncCycleCompletedOnFrontendLoop( sessions::SyncSessionSnapshot* snapshot); + void HandleStopSyncingPermanentlyOnFrontendLoop(); + // Called from Core::OnInitializationComplete to handle updating // frontend thread components. void HandleInitalizationCompletedOnFrontendLoop(); |