Chromium Code Reviews| Index: components/sync/core/shared_model_type_processor.cc |
| diff --git a/components/sync/core/shared_model_type_processor.cc b/components/sync/core/shared_model_type_processor.cc |
| index 85475769c889196ab6e59c3caa382d54b8758dd9..82b0a36618f09b7e9330f95b79456c84346b4e39 100644 |
| --- a/components/sync/core/shared_model_type_processor.cc |
| +++ b/components/sync/core/shared_model_type_processor.cc |
| @@ -202,6 +202,21 @@ void SharedModelTypeProcessor::GetAllNodes( |
| base::Unretained(this), task_runner, callback)); |
| } |
| +void SharedModelTypeProcessor::GetStatusCounters( |
| + const scoped_refptr<base::TaskRunner>& task_runner, |
| + const base::Callback<void(syncer::ModelType, |
| + const syncer::StatusCounters&)>& callback) { |
| + DCHECK(CalledOnValidThread()); |
| + syncer::StatusCounters counters; |
| + for (auto it = entities_.begin(); it != entities_.end(); ++it) { |
| + ++counters.num_entries_and_tombstones; |
|
pavely
2016/10/03 21:40:14
Please move num_entries_and_tombstones calculation
Gang Wu
2016/10/06 00:20:22
Done.
|
| + if (!it->second->metadata().is_deleted()) { |
| + ++counters.num_entries; |
| + } |
| + } |
| + task_runner->PostTask(FROM_HERE, base::Bind(callback, type_, counters)); |
| +} |
| + |
| void SharedModelTypeProcessor::DisableSync() { |
| DCHECK(CalledOnValidThread()); |
| std::unique_ptr<MetadataChangeList> change_list = |