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

Unified Diff: components/ukm/ukm_service.h

Issue 2671603002: Add network information to UKM (Closed)
Patch Set: provider test Created 3 years, 10 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/ukm/ukm_service.h
diff --git a/components/ukm/ukm_service.h b/components/ukm/ukm_service.h
index d154c7ce1f9b43fba5a2bd05a3baea232e9fbd0c..205603ec0e5f1df093d66c0099d6a613f70ff5ae 100644
--- a/components/ukm/ukm_service.h
+++ b/components/ukm/ukm_service.h
@@ -7,12 +7,14 @@
#include <stddef.h>
#include <memory>
+#include <vector>
#include "base/feature_list.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
#include "build/build_config.h"
+#include "components/metrics/metrics_provider.h"
#include "components/metrics/metrics_reporting_scheduler.h"
#include "components/metrics/persisted_logs.h"
@@ -60,6 +62,11 @@ class UkmService : public base::SupportsWeakPtr<UkmService> {
// Delete any unsent local data.
void Purge();
+ // Register the specified |provider| to provide additional metrics into the
Alexei Svitkine (slow) 2017/02/06 16:07:40 Nit: Registers Also can you change the tense of t
rkaplow 2017/02/06 16:31:41 fixed those and a few other comment
+ // UKM log. Should be called during MetricsService initialization only.
+ void RegisterMetricsProvider(
+ std::unique_ptr<metrics::MetricsProvider> provider);
+
// Registers the names of all of the preferences used by UkmService in
// the provided PrefRegistry.
static void RegisterPrefs(PrefRegistrySimple* registry);
@@ -100,6 +107,9 @@ class UkmService : public base::SupportsWeakPtr<UkmService> {
// instance.
metrics::MetricsServiceClient* const client_;
+ // Registered metrics providers.
+ std::vector<std::unique_ptr<metrics::MetricsProvider>> metrics_providers_;
+
// Logs that have not yet been sent.
metrics::PersistedLogs persisted_logs_;

Powered by Google App Engine
This is Rietveld 408576698