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/engine_impl/cycle/directory_type_debug_info_emitter.cc

Issue 2420213002: [USS] Show USS counters in Types tab (Closed)
Patch Set: git 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/engine_impl/cycle/directory_type_debug_info_emitter.cc
diff --git a/components/sync/engine_impl/cycle/directory_type_debug_info_emitter.cc b/components/sync/engine_impl/cycle/directory_type_debug_info_emitter.cc
index 975fd463755bbe97d447e2cbd17c916210cf8e03..5b709d3f5d34679e10f489ddb128f13373d4e8ec 100644
--- a/components/sync/engine_impl/cycle/directory_type_debug_info_emitter.cc
+++ b/components/sync/engine_impl/cycle/directory_type_debug_info_emitter.cc
@@ -4,8 +4,6 @@
#include "components/sync/engine_impl/cycle/directory_type_debug_info_emitter.h"
-#include <stdint.h>
-
#include <vector>
#include "components/sync/engine/cycle/status_counters.h"
@@ -19,50 +17,15 @@ DirectoryTypeDebugInfoEmitter::DirectoryTypeDebugInfoEmitter(
syncable::Directory* directory,
ModelType type,
base::ObserverList<TypeDebugInfoObserver>* observers)
- : directory_(directory),
- type_(type),
- type_debug_info_observers_(observers) {}
+ : DataTypeDebugInfoEmitter(type, observers), directory_(directory) {}
DirectoryTypeDebugInfoEmitter::DirectoryTypeDebugInfoEmitter(
ModelType type,
base::ObserverList<TypeDebugInfoObserver>* observers)
- : directory_(NULL), type_(type), type_debug_info_observers_(observers) {}
+ : DataTypeDebugInfoEmitter(type, observers), directory_(NULL) {}
DirectoryTypeDebugInfoEmitter::~DirectoryTypeDebugInfoEmitter() {}
-std::unique_ptr<base::ListValue> DirectoryTypeDebugInfoEmitter::GetAllNodes() {
- syncable::ReadTransaction trans(FROM_HERE, directory_);
- std::unique_ptr<base::ListValue> nodes(
- directory_->GetNodeDetailsForType(&trans, type_));
- return nodes;
-}
-
-const CommitCounters& DirectoryTypeDebugInfoEmitter::GetCommitCounters() const {
- return commit_counters_;
-}
-
-CommitCounters* DirectoryTypeDebugInfoEmitter::GetMutableCommitCounters() {
- return &commit_counters_;
-}
-
-void DirectoryTypeDebugInfoEmitter::EmitCommitCountersUpdate() {
- FOR_EACH_OBSERVER(TypeDebugInfoObserver, (*type_debug_info_observers_),
- OnCommitCountersUpdated(type_, commit_counters_));
-}
-
-const UpdateCounters& DirectoryTypeDebugInfoEmitter::GetUpdateCounters() const {
- return update_counters_;
-}
-
-UpdateCounters* DirectoryTypeDebugInfoEmitter::GetMutableUpdateCounters() {
- return &update_counters_;
-}
-
-void DirectoryTypeDebugInfoEmitter::EmitUpdateCountersUpdate() {
- FOR_EACH_OBSERVER(TypeDebugInfoObserver, (*type_debug_info_observers_),
- OnUpdateCountersUpdated(type_, update_counters_));
-}
-
void DirectoryTypeDebugInfoEmitter::EmitStatusCountersUpdate() {
// This is expensive. Avoid running this code unless about:sync is open.
if (!type_debug_info_observers_->might_have_observers())
@@ -83,8 +46,9 @@ void DirectoryTypeDebugInfoEmitter::EmitStatusCountersUpdate() {
}
}
- FOR_EACH_OBSERVER(TypeDebugInfoObserver, (*type_debug_info_observers_),
- OnStatusCountersUpdated(type_, counters));
+ for (TypeDebugInfoObserver& obsever : *type_debug_info_observers_) {
+ obsever.OnStatusCountersUpdated(type_, counters);
+ }
}
} // namespace syncer

Powered by Google App Engine
This is Rietveld 408576698