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

Unified Diff: chrome/browser/sync/profile_sync_service.cc

Issue 8496002: Sync: Improve handling of database load failures (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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/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;
}
« chrome/browser/sync/profile_sync_service.h ('K') | « chrome/browser/sync/profile_sync_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698