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

Unified Diff: sync/internal_api/sync_backup_manager.cc

Issue 363543002: Properly handle initialization failure and following manager shutdown without (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« no previous file with comments | « no previous file | sync/internal_api/sync_backup_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/sync_backup_manager.cc
diff --git a/sync/internal_api/sync_backup_manager.cc b/sync/internal_api/sync_backup_manager.cc
index d421dfd9f1cb39a0685defa07fc346cb65d448ac..91927e717edd121c6dbe47dec1d0d99e0746c389 100644
--- a/sync/internal_api/sync_backup_manager.cc
+++ b/sync/internal_api/sync_backup_manager.cc
@@ -50,17 +50,22 @@ void SyncBackupManager::Init(
report_unrecoverable_error_function,
cancelation_signal);
+ if (!initialized())
+ return;
+
GetUserShare()->directory->CollectMetaHandleCounts(
- &status_.num_entries_by_type,
- &status_.num_to_delete_entries_by_type);
+ &status_.num_entries_by_type,
+ &status_.num_to_delete_entries_by_type);
HideSyncPreference(PRIORITY_PREFERENCES);
HideSyncPreference(PREFERENCES);
}
void SyncBackupManager::SaveChanges() {
- NormalizeEntries();
- GetUserShare()->directory->SaveChanges();
+ if (initialized()) {
+ NormalizeEntries();
+ GetUserShare()->directory->SaveChanges();
+ }
}
SyncStatus SyncBackupManager::GetDetailedStatus() const {
« no previous file with comments | « no previous file | sync/internal_api/sync_backup_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698