Index: components/ukm/ukm_service.h |
diff --git a/components/ukm/ukm_service.h b/components/ukm/ukm_service.h |
index 0c5172e83c5070786b8f07afad9f4ad15e72c7f7..a32bc7de17b2cebedbc9c8c295718f2df7334855 100644 |
--- a/components/ukm/ukm_service.h |
+++ b/components/ukm/ukm_service.h |
@@ -25,6 +25,8 @@ class MetricsServiceClient; |
namespace ukm { |
+class UkmSource; |
+ |
// This feature controls whether UkmService should be created. |
extern const base::Feature kUkmFeature; |
@@ -47,6 +49,8 @@ class UkmService : public base::SupportsWeakPtr<UkmService> { |
void EnableReporting(); |
void DisableReporting(); |
+ void RecordSource(std::unique_ptr<UkmSource> source); |
+ |
// Record any collected data into logs, and write to disk. |
void Flush(); |
@@ -57,6 +61,11 @@ class UkmService : public base::SupportsWeakPtr<UkmService> { |
// the provided PrefRegistry. |
static void RegisterPrefs(PrefRegistrySimple* registry); |
+ protected: |
+ const std::vector<std::unique_ptr<UkmSource>>& sources_for_testing() const { |
+ return sources_; |
+ } |
+ |
private: |
// Start metrics client initialization. |
void StartInitTask(); |
@@ -103,6 +112,8 @@ class UkmService : public base::SupportsWeakPtr<UkmService> { |
bool initialize_complete_; |
bool log_upload_in_progress_; |
+ std::vector<std::unique_ptr<UkmSource>> sources_; |
+ |
// Weak pointers factory used to post task on different threads. All weak |
// pointers managed by this factory have the same lifetime as UkmService. |
base::WeakPtrFactory<UkmService> self_ptr_factory_; |