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

Unified Diff: chrome/browser/sync/glue/sync_backend_host.cc

Issue 11474036: Remove initial_sync_ended bits (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another rebase Created 8 years 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 | « chrome/browser/sync/about_sync_util.cc ('k') | chrome/browser/sync/glue/sync_backend_host_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 96dd732f923ce32e0e35514673fd4b4f2197457c..22acf723777a7049a2edab9ba29f8969d4e1edd6 100644
--- a/chrome/browser/sync/glue/sync_backend_host.cc
+++ b/chrome/browser/sync/glue/sync_backend_host.cc
@@ -676,10 +676,10 @@ void SyncBackendHost::ConfigureDataTypes(
// downloaded if they are enabled.
//
// The SyncBackendRegistrar's state was initially derived from the types
- // marked initial_sync_ended when the sync database was loaded. Afterwards it
- // is modified only by this function. We expect it to remain in sync with the
+ // detected to have been downloaded in the database. Afterwards it is
+ // modified only by this function. We expect it to remain in sync with the
// backend because configuration requests are never aborted; they are retried
- // until they succeed or the browser is closed.
+ // until they succeed or the backend is shut down.
syncer::ModelTypeSet types_to_download = registrar_->ConfigureDataTypes(
types_to_add, types_to_remove);
@@ -692,10 +692,10 @@ void SyncBackendHost::ConfigureDataTypes(
// prepared to handle a migration during a configure, so we must ensure that
// all our types_to_download actually contain no data before we sync them.
//
- // The most common way to end up in this situation used to be types which had
- // !initial_sync_ended, but did have some progress markers. We avoid problems
- // with those types by purging the data of any such partially synced types
- // soon after we load the directory.
+ // One common way to end up in this situation used to be types which
+ // downloaded some or all of their data but have not applied it yet. We avoid
+ // problems with those types by purging the data of any such partially synced
+ // types soon after we load the directory.
//
// Another possible scenario is that we have newly supported or newly enabled
// data types being downloaded here but the nigori type, which is always
@@ -1241,6 +1241,15 @@ void SyncBackendHost::Core::DoInitialProcessControlTypes() {
return;
}
+ if (!sync_manager_->InitialSyncEndedTypes().HasAll(syncer::ControlTypes())) {
+ LOG(ERROR) << "Failed to download control types";
+ host_.Call(
+ FROM_HERE,
+ &SyncBackendHost::HandleInitializationCompletedOnFrontendLoop,
+ false);
+ return;
+ }
+
// Initialize device info. This is asynchronous on some platforms, so we
// provide a callback for when it finishes.
synced_device_tracker_.reset(
« no previous file with comments | « chrome/browser/sync/about_sync_util.cc ('k') | chrome/browser/sync/glue/sync_backend_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698