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

Unified Diff: components/sync/engine_impl/syncer.cc

Issue 2718533003: [Sync] Adjust types to configure during shutdown (Closed)
Patch Set: Created 3 years, 10 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 | « chrome/browser/sync/test/integration/sync_errors_test.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/sync/engine_impl/syncer.cc
diff --git a/components/sync/engine_impl/syncer.cc b/components/sync/engine_impl/syncer.cc
index 76b7da36884a3b16efe58ab39d81889e86db62c9..97d6cb6f6c4fce76812ca3289e20a077428bcac3 100644
--- a/components/sync/engine_impl/syncer.cc
+++ b/components/sync/engine_impl/syncer.cc
@@ -82,6 +82,15 @@ bool Syncer::ConfigureSyncShare(
VLOG(1) << "Configuring types " << ModelTypeSetToString(request_types);
HandleCycleBegin(cycle);
ConfigureGetUpdatesDelegate configure_delegate(source);
+
+ // It is possible during shutdown that datatypes get unregistered from
+ // ModelTypeRegistry before scheduled configure sync cycle gets executed.
+ // When it happens we should adjust set of types to download to only include
+ // registered types.
+ if (cancelation_signal_->IsSignalled())
skym 2017/02/24 17:04:25 Would be good to have a unit test for this as well
pavely 2017/02/24 18:54:32 Done.
+ request_types.RetainAll(
+ cycle->context()->model_type_registry()->GetEnabledTypes());
+
GetUpdatesProcessor get_updates_processor(
cycle->context()->model_type_registry()->update_handler_map(),
configure_delegate);
« no previous file with comments | « chrome/browser/sync/test/integration/sync_errors_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698