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

Unified Diff: components/sync/driver/model_type_controller.cc

Issue 2563423005: [Sync] Move ConfigureDataTypes logic into DataTypeManagerImpl. (Closed)
Patch Set: Address comments. Created 3 years, 11 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
Index: components/sync/driver/model_type_controller.cc
diff --git a/components/sync/driver/model_type_controller.cc b/components/sync/driver/model_type_controller.cc
index 9dbe973ef1c717670f6a676dc7c1f18b998bbee5..bb93d04978420be740b4c4069564649d927c35c0 100644
--- a/components/sync/driver/model_type_controller.cc
+++ b/components/sync/driver/model_type_controller.cc
@@ -159,13 +159,19 @@ void ModelTypeController::OnProcessorStarted(
LoadModelsDone(result, error);
}
-void ModelTypeController::RegisterWithBackend(ModelTypeConfigurer* configurer) {
+void ModelTypeController::RegisterWithBackend(
+ base::Callback<void(bool)> set_downloaded,
+ ModelTypeConfigurer* configurer) {
DCHECK(CalledOnValidThread());
if (activated_)
return;
DCHECK(configurer);
DCHECK(activation_context_);
DCHECK_EQ(MODEL_LOADED, state_);
+ // Inform the DataTypeManager whether our initial download is complete.
+ set_downloaded.Run(activation_context_->model_type_state.initial_sync_done());
+ // Pass activation context to ModelTypeRegistry, where ModelTypeWorker gets
+ // created and connected with ModelTypeProcessor.
configurer->ActivateNonBlockingDataType(type(),
std::move(activation_context_));
activated_ = true;
« no previous file with comments | « components/sync/driver/model_type_controller.h ('k') | components/sync/driver/model_type_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698