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

Unified Diff: components/sync/core/shared_model_type_processor.cc

Issue 2374913002: [USS] Show USS counters in about:sync page (Closed)
Patch Set: remove unique_ptr and rebase Created 4 years, 2 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/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 =

Powered by Google App Engine
This is Rietveld 408576698