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

Unified Diff: components/metrics/metrics_service.h

Issue 1374283003: Reporting top cpu and memory consumers via rappor on chromeos (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: browser/gpu stats by UMA histograms, buckets for cpu cores. Created 5 years, 1 month 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/metrics/metrics_service.h
diff --git a/components/metrics/metrics_service.h b/components/metrics/metrics_service.h
index 5a63352092993d40899195299874790609845cd9..e411f1bc018253bbea5c21d7d1bb5bfa134f73dd 100644
--- a/components/metrics/metrics_service.h
+++ b/components/metrics/metrics_service.h
@@ -88,6 +88,16 @@ class SyntheticTrialObserver {
virtual ~SyntheticTrialObserver() {}
};
+// Interface for observing whenever the MetricsService is started or stopped.
+class MetricsServiceObserver {
+ public:
+ virtual void OnMetricsServiceStart() = 0;
+ virtual void OnMetricsServiceStop() = 0;
+
+ protected:
+ virtual ~MetricsServiceObserver() {}
+};
+
// See metrics_service.cc for a detailed description.
class MetricsService : public base::HistogramFlattener {
public:
@@ -232,6 +242,11 @@ class MetricsService : public base::HistogramFlattener {
// Removes an existing observer of synthetic trials list changes.
void RemoveSyntheticTrialObserver(SyntheticTrialObserver* observer);
+ // Add / remove observers interested in watching the MetricsService start and
+ // stop events.
+ void AddObserver(MetricsServiceObserver* observer);
+ void RemoveObserver(MetricsServiceObserver* observer);
+
// Register the specified |provider| to provide additional metrics into the
// UMA log. Should be called during MetricsService initialization only.
void RegisterMetricsProvider(scoped_ptr<MetricsProvider> provider);
@@ -486,6 +501,10 @@ class MetricsService : public base::HistogramFlattener {
// List of observers of |synthetic_trial_groups_| changes.
base::ObserverList<SyntheticTrialObserver> synthetic_trial_observer_list_;
+ // List of observers interested in watching the MetricsService start and stop
+ // events.
+ base::ObserverList<MetricsServiceObserver> metrics_service_observer_list_;
+
// Execution phase the browser is in.
static ExecutionPhase execution_phase_;

Powered by Google App Engine
This is Rietveld 408576698