Index: chrome/browser/sync/profile_sync_service.cc |
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc |
index a94366e5990b5e7967ab9e54f51c62d1d2a6fb3f..ea95da1caee433feee62d9c042a4dbfe6c3124cf 100644 |
--- a/chrome/browser/sync/profile_sync_service.cc |
+++ b/chrome/browser/sync/profile_sync_service.cc |
@@ -372,7 +372,7 @@ void ProfileSyncService::StartUp() { |
} |
} |
-void ProfileSyncService::Shutdown(bool sync_disabled) { |
+void ProfileSyncService::Shutdown(bool delete_stale_data) { |
// First, we spin down the backend and wait for it to stop syncing completely |
// before we Stop the data type manager. This is to avoid a late sync cycle |
// applying changes to the sync db that wouldn't get applied via |
@@ -413,7 +413,7 @@ void ProfileSyncService::Shutdown(bool sync_disabled) { |
// shutting it down. |
scoped_ptr<SyncBackendHost> doomed_backend(backend_.release()); |
if (doomed_backend.get()) { |
- doomed_backend->Shutdown(sync_disabled); |
+ doomed_backend->Shutdown(delete_stale_data); |
doomed_backend.reset(); |
} |
@@ -556,10 +556,10 @@ void ProfileSyncService::OnUnrecoverableError( |
void ProfileSyncService::OnBackendInitialized( |
const WeakHandle<JsBackend>& js_backend, bool success) { |
if (!success) { |
- // If backend initialization failed, abort. We only want to blow away |
- // state (DBs, etc) if this was a first-time scenario that failed. |
+ // We may have gotten here because the sync database is corrupt. We |
+ // force its deletion, just in case. |
wizard_.Step(SyncSetupWizard::FATAL_ERROR); |
- Shutdown(!HasSyncSetupCompleted()); |
+ Shutdown(true); |
return; |
} |