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

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

Issue 2374913002: [USS] Show USS counters in about:sync page (Closed)
Patch Set: For IOS Created 4 years, 3 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..39065d405ac0fc0707661a2bfb9f86c6f4a51e3e 100644
--- a/components/sync/core/shared_model_type_processor.cc
+++ b/components/sync/core/shared_model_type_processor.cc
@@ -202,6 +202,24 @@ 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,
+ std::unique_ptr<syncer::StatusCounters>)>
+ callback) {
+ DCHECK(CalledOnValidThread());
+ std::unique_ptr<syncer::StatusCounters> counters =
+ base::MakeUnique<syncer::StatusCounters>();
+ for (auto it = entities_.begin(); it != entities_.end(); ++it) {
+ ++counters->num_entries_and_tombstones;
+ if (!it->second->metadata().is_deleted()) {
+ ++counters->num_entries;
+ }
+ }
+ task_runner->PostTask(FROM_HERE,
+ base::Bind(callback, type_, base::Passed(&counters)));
+}
+
void SharedModelTypeProcessor::DisableSync() {
DCHECK(CalledOnValidThread());
std::unique_ptr<MetadataChangeList> change_list =

Powered by Google App Engine
This is Rietveld 408576698