Chromium Code Reviews| Index: components/syncable_prefs/pref_model_associator.cc |
| diff --git a/components/syncable_prefs/pref_model_associator.cc b/components/syncable_prefs/pref_model_associator.cc |
| index 4cbdd558881022f6e5abb32c4cd5e53da6e8baf8..1148b1b9cbda3fe462561aa73ba543bbd0ae7532 100644 |
| --- a/components/syncable_prefs/pref_model_associator.cc |
| +++ b/components/syncable_prefs/pref_model_associator.cc |
| @@ -157,6 +157,14 @@ void PrefModelAssociator::InitPrefAndAssociate( |
| // we'll send the new user controlled value to the syncer. |
| } |
| +void PrefModelAssociator::RegisterMergeDataFinishedCallback( |
| + const base::Closure& callback) { |
| + if (!models_associated_) |
| + callback_list_.push_back(callback); |
| + else |
| + callback.Run(); |
| +} |
| + |
| syncer::SyncMergeResult PrefModelAssociator::MergeDataAndStartSyncing( |
| syncer::ModelType type, |
| const syncer::SyncDataList& initial_sync_data, |
| @@ -207,6 +215,10 @@ syncer::SyncMergeResult PrefModelAssociator::MergeDataAndStartSyncing( |
| InitPrefAndAssociate(syncer::SyncData(), *pref_name_iter, &new_changes); |
| } |
| + for (const auto& callback : callback_list_) |
| + callback.Run(); |
| + callback_list_.clear(); |
|
pavely
2016/07/06 22:11:56
I think it is possible that MergeDataAndStartSynci
lshang
2016/07/07 08:26:05
I think in this case even though the migration cod
|
| + |
| // Push updates to sync. |
| merge_result.set_error( |
| sync_processor_->ProcessSyncChanges(FROM_HERE, new_changes)); |