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

Unified Diff: components/browser_sync/profile_sync_service.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/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 f949818c3d78d204f6c6877e4fddec3923367257..2b95fdd998c9b407bc22669fee9b0b4ba5c67cde 100644
--- a/components/browser_sync/profile_sync_service.cc
+++ b/components/browser_sync/profile_sync_service.cc
@@ -556,11 +556,11 @@ void ProfileSyncService::OnDirectoryTypeUpdateCounterUpdated(
OnUpdateCountersUpdated(type, counters));
}
-void ProfileSyncService::OnDirectoryTypeStatusCounterUpdated(
+void ProfileSyncService::OnDatatypeStatusCounterUpdated(
syncer::ModelType type,
- const syncer::StatusCounters& counters) {
+ std::unique_ptr<syncer::StatusCounters> counters) {
FOR_EACH_OBSERVER(syncer::TypeDebugInfoObserver, type_debug_info_observers_,
- OnStatusCountersUpdated(type, counters));
+ OnStatusCountersUpdated(type, std::move(counters)));
pavely 2016/09/30 00:01:51 This macro expands into a loop with function invoc
Gang Wu 2016/10/01 07:14:09 my bad, will update.
}
void ProfileSyncService::OnDataTypeRequestsSyncStartup(syncer::ModelType type) {
@@ -1821,7 +1821,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_) {
@@ -1904,11 +1904,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,
+ base::Unretained(this)));
+ }
result->Append(std::move(type_status));
}

Powered by Google App Engine
This is Rietveld 408576698