| Index: components/ukm/ukm_service.h
|
| diff --git a/components/ukm/ukm_service.h b/components/ukm/ukm_service.h
|
| index 9ffd417d54bbc5b6ae8ba505987118ae25679bec..bcb223d7ace2eadd972b976cadfa9f2ae5650eeb 100644
|
| --- a/components/ukm/ukm_service.h
|
| +++ b/components/ukm/ukm_service.h
|
| @@ -26,6 +26,8 @@ class MetricsServiceClient;
|
|
|
| namespace ukm {
|
|
|
| +class UkmSource;
|
| +
|
| // This feature controls whether UkmService should be created.
|
| extern const base::Feature kUkmFeature;
|
|
|
| @@ -48,6 +50,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();
|
|
|
| @@ -58,6 +62,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();
|
| @@ -104,6 +113,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_;
|
|
|