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

Unified Diff: components/browser_sync/profile_sync_service.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/browser_sync/profile_sync_service.cc
diff --git a/components/browser_sync/profile_sync_service.cc b/components/browser_sync/profile_sync_service.cc
index 0b9152f3ca5e0f83cbf97a5e9fe344a67dbaac3c..ce6d0771e66cea59c00f4a4da75458c46cf4e20c 100644
--- a/components/browser_sync/profile_sync_service.cc
+++ b/components/browser_sync/profile_sync_service.cc
@@ -543,7 +543,7 @@ void ProfileSyncService::OnDirectoryTypeUpdateCounterUpdated(
OnUpdateCountersUpdated(type, counters));
}
-void ProfileSyncService::OnDirectoryTypeStatusCounterUpdated(
+void ProfileSyncService::OnDatatypeStatusCounterUpdated(
syncer::ModelType type,
const syncer::StatusCounters& counters) {
FOR_EACH_OBSERVER(syncer::TypeDebugInfoObserver, type_debug_info_observers_,
@@ -1807,7 +1807,7 @@ void ProfileSyncService::GetModelSafeRoutingInfo(
}
}
-base::Value* ProfileSyncService::GetTypeStatusMap() const {
+base::Value* ProfileSyncService::GetTypeStatusMap() {
std::unique_ptr<base::ListValue> result(new base::ListValue());
if (!backend_.get() || !backend_initialized_) {
@@ -1890,11 +1890,12 @@ base::Value* ProfileSyncService::GetTypeStatusMap() const {
type_status->SetString("value", "Disabled by User");
}
- int live_count = detailed_status.num_entries_by_type[type] -
- detailed_status.num_to_delete_entries_by_type[type];
- type_status->SetInteger("num_entries",
- detailed_status.num_entries_by_type[type]);
- type_status->SetInteger("num_live", live_count);
+ const auto& dtc_iter = data_type_controllers_.find(type);
+ if (dtc_iter != data_type_controllers_.end()) {
+ dtc_iter->second->GetStatusCounters(
+ base::Bind(&ProfileSyncService::OnDatatypeStatusCounterUpdated,
maxbogue 2016/10/04 00:02:00 If this Bind call were wrapped with syncer::BindTo
Gang Wu 2016/10/06 00:20:22 Done.
+ base::Unretained(this)));
+ }
result->Append(std::move(type_status));
}

Powered by Google App Engine
This is Rietveld 408576698