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

Unified Diff: components/sync/engine_impl/cycle/directory_type_debug_info_emitter.h

Issue 2420213002: [USS] Show USS counters in Types tab (Closed)
Patch Set: 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.h
diff --git a/components/sync/engine_impl/cycle/directory_type_debug_info_emitter.h b/components/sync/engine_impl/cycle/directory_type_debug_info_emitter.h
index 8334abec8101a2d1c2c9ec977de0eb2087b85122..ba2daab91a9e494da638613f675e69275be005ad 100644
--- a/components/sync/engine_impl/cycle/directory_type_debug_info_emitter.h
+++ b/components/sync/engine_impl/cycle/directory_type_debug_info_emitter.h
@@ -5,41 +5,15 @@
#ifndef COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_DIRECTORY_TYPE_DEBUG_INFO_EMITTER_H_
#define COMPONENTS_SYNC_ENGINE_IMPL_CYCLE_DIRECTORY_TYPE_DEBUG_INFO_EMITTER_H_
-#include <memory>
-
#include "base/macros.h"
-#include "base/observer_list.h"
-#include "base/values.h"
-#include "components/sync/engine/cycle/commit_counters.h"
-#include "components/sync/engine/cycle/update_counters.h"
+#include "components/sync/engine_impl/cycle/data_type_debug_info_emitter.h"
#include "components/sync/syncable/directory.h"
namespace syncer {
-class DirectoryCommitContributor;
-class TypeDebugInfoObserver;
-
-// Supports various kinds of debugging requests for a certain directory type.
-//
-// The GetAllNodes() function is used to help export a snapshot of all current
-// nodes to its caller. The complexity required to manage the request mostly
-// lives elsewhere.
-//
-// The Emit*() functions send updates to registered TypeDebugInfoObservers.
-// The DirectoryTypeDebugInfoEmitter does not directly own that list; it is
-// managed by the ModelTypeRegistry.
-//
-// For Update and Commit counters, the job of keeping the counters up to date
-// is delegated to the UpdateHandler and CommitContributors. For the Stats
-// counters, the emitter will use its type_ and directory_ members to fetch all
-// the required information on demand.
-class DirectoryTypeDebugInfoEmitter {
+class DirectoryTypeDebugInfoEmitter : public DataTypeDebugInfoEmitter {
public:
// Standard constructor for non-tests.
- //
- // The |directory| and |observers| arguments are not owned. Both may be
- // modified outside of this object and both are expected to outlive this
- // object.
DirectoryTypeDebugInfoEmitter(
syncable::Directory* directory,
ModelType type,
@@ -50,46 +24,14 @@ class DirectoryTypeDebugInfoEmitter {
ModelType type,
base::ObserverList<TypeDebugInfoObserver>* observers);
- virtual ~DirectoryTypeDebugInfoEmitter();
-
- // Returns a ListValue representation of all known nodes of this type.
- std::unique_ptr<base::ListValue> GetAllNodes();
-
- // Returns a reference to the current commit counters.
- const CommitCounters& GetCommitCounters() const;
-
- // Allows others to mutate the commit counters.
- CommitCounters* GetMutableCommitCounters();
-
- // Triggerss a commit counters update to registered observers.
- void EmitCommitCountersUpdate();
-
- // Returns a reference to the current update counters.
- const UpdateCounters& GetUpdateCounters() const;
-
- // Allows others to mutate the update counters.
- UpdateCounters* GetMutableUpdateCounters();
-
- // Triggers an update counters update to registered observers.
- void EmitUpdateCountersUpdate();
+ ~DirectoryTypeDebugInfoEmitter() override;
// Triggers a status counters update to registered observers.
- void EmitStatusCountersUpdate();
+ void EmitStatusCountersUpdate() override;
private:
syncable::Directory* directory_;
- const ModelType type_;
-
- CommitCounters commit_counters_;
- UpdateCounters update_counters_;
-
- // Because there are so many emitters that come into and out of existence, it
- // doesn't make sense to have them manage their own observer list. They all
- // share one observer list that is provided by their owner and which is
- // guaranteed to outlive them.
- base::ObserverList<TypeDebugInfoObserver>* type_debug_info_observers_;
-
DISALLOW_COPY_AND_ASSIGN(DirectoryTypeDebugInfoEmitter);
};

Powered by Google App Engine
This is Rietveld 408576698