| Index: components/sync_driver/glue/sync_backend_registrar.cc
|
| diff --git a/components/sync_driver/glue/sync_backend_registrar.cc b/components/sync_driver/glue/sync_backend_registrar.cc
|
| index 0cd87c2d2fb6aa3e6a0c6284876613324db8fa02..a33ed82462308c885019d15d6f8c5222117f8bc6 100644
|
| --- a/components/sync_driver/glue/sync_backend_registrar.cc
|
| +++ b/components/sync_driver/glue/sync_backend_registrar.cc
|
| @@ -51,6 +51,12 @@ SyncBackendRegistrar::SyncBackendRegistrar(
|
| DCHECK_GT(workers_.size(), 0u);
|
| }
|
|
|
| +void SyncBackendRegistrar::RegisterNonBlockingType(syncer::ModelType type) {
|
| + DCHECK(routing_info_.find(type) == routing_info_.end() ||
|
| + routing_info_[type] == syncer::GROUP_NON_BLOCKING);
|
| + non_blocking_types_.Put(type);
|
| +}
|
| +
|
| void SyncBackendRegistrar::SetInitialTypes(syncer::ModelTypeSet initial_types) {
|
| base::AutoLock lock(lock_);
|
|
|
| @@ -63,7 +69,7 @@ void SyncBackendRegistrar::SetInitialTypes(syncer::ModelTypeSet initial_types) {
|
| // return correct results.
|
| for (syncer::ModelTypeSet::Iterator it = initial_types.First(); it.Good();
|
| it.Inc()) {
|
| - routing_info_[it.Get()] = syncer::GROUP_PASSIVE;
|
| + routing_info_[it.Get()] = GetInitialGroupForType(it.Get());
|
| }
|
|
|
| if (!workers_.count(syncer::GROUP_HISTORY)) {
|
| @@ -108,7 +114,7 @@ syncer::ModelTypeSet SyncBackendRegistrar::ConfigureDataTypes(
|
| // Add a newly specified data type as syncer::GROUP_PASSIVE into the
|
| // routing_info, if it does not already exist.
|
| if (routing_info_.count(it.Get()) == 0) {
|
| - routing_info_[it.Get()] = syncer::GROUP_PASSIVE;
|
| + routing_info_[it.Get()] = GetInitialGroupForType(it.Get());
|
| newly_added_types.Put(it.Get());
|
| }
|
| }
|
| @@ -351,4 +357,12 @@ base::Thread* SyncBackendRegistrar::sync_thread() {
|
| return sync_thread_.get();
|
| }
|
|
|
| +syncer::ModelSafeGroup SyncBackendRegistrar::GetInitialGroupForType(
|
| + syncer::ModelType type) const {
|
| + if (non_blocking_types_.Has(type))
|
| + return syncer::GROUP_NON_BLOCKING;
|
| + else
|
| + return syncer::GROUP_PASSIVE;
|
| +}
|
| +
|
| } // namespace browser_sync
|
|
|