Index: chrome/browser/sync/glue/sync_backend_host.cc |
diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc |
index 4834411656a671de9ff642ef7ae0fb51e5c7523d..f4de838a11eae7221e13c6c8c7ab0bf9d82bcea2 100644 |
--- a/chrome/browser/sync/glue/sync_backend_host.cc |
+++ b/chrome/browser/sync/glue/sync_backend_host.cc |
@@ -217,12 +217,12 @@ void SyncBackendHost::StopSyncingForShutdown() { |
} |
} |
-void SyncBackendHost::Shutdown(bool sync_disabled) { |
+void SyncBackendHost::Shutdown(bool delete_stale_data) { |
// TODO(tim): DCHECK(registrar_->StoppedOnUIThread()) would be nice. |
if (sync_thread_.IsRunning()) { |
sync_thread_.message_loop()->PostTask(FROM_HERE, |
base::Bind(&SyncBackendHost::Core::DoShutdown, core_.get(), |
- sync_disabled)); |
+ delete_stale_data)); |
} |
// Stop will return once the thread exits, which will be after DoShutdown |
@@ -420,8 +420,11 @@ void SyncBackendHost::Core::OnInitializationComplete( |
base::Bind(&Core::HandleInitializationCompletedOnFrontendLoop, this, |
js_backend, success)); |
- // Initialization is complete, so we can schedule recurring SaveChanges. |
- sync_loop_->PostTask(FROM_HERE, base::Bind(&Core::StartSavingChanges, this)); |
+ if (success) { |
+ // Initialization is complete, so we can schedule recurring SaveChanges. |
+ sync_loop_->PostTask(FROM_HERE, |
+ base::Bind(&Core::StartSavingChanges, this)); |
+ } |
} |
void SyncBackendHost::Core::OnAuthError(const AuthError& auth_error) { |
@@ -608,7 +611,6 @@ void SyncBackendHost::Core::DoInitialize(const DoInitializeOptions& options) { |
host_->sync_notifier_factory_.CreateSyncNotifier(), |
options.restored_key_for_bootstrapping, |
options.setup_for_test_mode); |
- DCHECK(success) << "Syncapi initialization failed!"; |
Nicolas Zea
2011/11/08 22:12:18
LOG_IF(ERROR, !success) would still be useful I th
rlarocque
2011/11/11 22:24:56
Done.
|
} |
void SyncBackendHost::Core::DoCheckServerReachable() { |
@@ -666,7 +668,7 @@ void SyncBackendHost::Core::DoStopSyncManagerForShutdown( |
sync_manager_->StopSyncingForShutdown(closure); |
} |
-void SyncBackendHost::Core::DoShutdown(bool sync_disabled) { |
+void SyncBackendHost::Core::DoShutdown(bool delete_stale_data) { |
DCHECK_EQ(MessageLoop::current(), sync_loop_); |
if (!sync_manager_.get()) |
return; |
@@ -677,7 +679,7 @@ void SyncBackendHost::Core::DoShutdown(bool sync_disabled) { |
sync_manager_.reset(); |
registrar_ = NULL; |
- if (sync_disabled) |
+ if (delete_stale_data) |
DeleteSyncDataFolder(); |
sync_loop_ = NULL; |