| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SERVICES_METRICS_PUBLIC_CPP_UKM_RECORDER_H_ | 5 #ifndef SERVICES_METRICS_PUBLIC_CPP_UKM_RECORDER_H_ |
| 6 #define SERVICES_METRICS_PUBLIC_CPP_UKM_RECORDER_H_ | 6 #define SERVICES_METRICS_PUBLIC_CPP_UKM_RECORDER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 | 48 |
| 49 namespace payments { | 49 namespace payments { |
| 50 class JourneyLogger; | 50 class JourneyLogger; |
| 51 } | 51 } |
| 52 | 52 |
| 53 namespace password_manager { | 53 namespace password_manager { |
| 54 class PasswordManagerMetricsRecorder; | 54 class PasswordManagerMetricsRecorder; |
| 55 class PasswordFormMetricsRecorder; | 55 class PasswordFormMetricsRecorder; |
| 56 } // namespace password_manager | 56 } // namespace password_manager |
| 57 | 57 |
| 58 namespace previews { |
| 59 class PreviewsUKMObserver; |
| 60 } |
| 61 |
| 58 namespace ukm { | 62 namespace ukm { |
| 59 | 63 |
| 60 class UkmEntryBuilder; | 64 class UkmEntryBuilder; |
| 61 class UkmInterface; | 65 class UkmInterface; |
| 62 class TestRecordingHelper; | 66 class TestRecordingHelper; |
| 63 | 67 |
| 64 // This feature controls whether UkmService should be created. | 68 // This feature controls whether UkmService should be created. |
| 65 METRICS_EXPORT extern const base::Feature kUkmFeature; | 69 METRICS_EXPORT extern const base::Feature kUkmFeature; |
| 66 | 70 |
| 67 typedef int64_t SourceId; | 71 typedef int64_t SourceId; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 friend ServiceWorkerPageLoadMetricsObserver; | 107 friend ServiceWorkerPageLoadMetricsObserver; |
| 104 friend SubresourceFilterMetricsObserver; | 108 friend SubresourceFilterMetricsObserver; |
| 105 friend translate::TranslateRankerImpl; | 109 friend translate::TranslateRankerImpl; |
| 106 friend TestRecordingHelper; | 110 friend TestRecordingHelper; |
| 107 friend UkmInterface; | 111 friend UkmInterface; |
| 108 friend content::MediaInternals; | 112 friend content::MediaInternals; |
| 109 friend content::RenderFrameImpl; | 113 friend content::RenderFrameImpl; |
| 110 friend content::RenderWidgetHostLatencyTracker; | 114 friend content::RenderWidgetHostLatencyTracker; |
| 111 friend password_manager::PasswordManagerMetricsRecorder; | 115 friend password_manager::PasswordManagerMetricsRecorder; |
| 112 friend password_manager::PasswordFormMetricsRecorder; | 116 friend password_manager::PasswordFormMetricsRecorder; |
| 117 friend previews::PreviewsUKMObserver; |
| 113 friend resource_coordinator::CoordinationUnitManager; | 118 friend resource_coordinator::CoordinationUnitManager; |
| 114 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, AddEntryWithEmptyMetrics); | 119 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, AddEntryWithEmptyMetrics); |
| 115 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, EntryBuilderAndSerialization); | 120 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, EntryBuilderAndSerialization); |
| 116 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, | 121 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, |
| 117 LogsUploadedOnlyWhenHavingSourcesOrEntries); | 122 LogsUploadedOnlyWhenHavingSourcesOrEntries); |
| 118 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, MetricsProviderTest); | 123 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, MetricsProviderTest); |
| 119 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, PersistAndPurge); | 124 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, PersistAndPurge); |
| 120 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, WhitelistEntryTest); | 125 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, WhitelistEntryTest); |
| 121 | 126 |
| 122 // Get a new UkmEntryBuilder object for the specified source ID and event, | 127 // Get a new UkmEntryBuilder object for the specified source ID and event, |
| 123 // which can get metrics added to. | 128 // which can get metrics added to. |
| 124 // | 129 // |
| 125 // This API being private is intentional. Any client using UKM needs to | 130 // This API being private is intentional. Any client using UKM needs to |
| 126 // declare itself to be a friend of UkmService and go through code review | 131 // declare itself to be a friend of UkmService and go through code review |
| 127 // process. | 132 // process. |
| 128 std::unique_ptr<UkmEntryBuilder> GetEntryBuilder(SourceId source_id, | 133 std::unique_ptr<UkmEntryBuilder> GetEntryBuilder(SourceId source_id, |
| 129 const char* event_name); | 134 const char* event_name); |
| 130 | 135 |
| 131 private: | 136 private: |
| 132 // Add an entry to the UkmEntry list. | 137 // Add an entry to the UkmEntry list. |
| 133 virtual void AddEntry(mojom::UkmEntryPtr entry) = 0; | 138 virtual void AddEntry(mojom::UkmEntryPtr entry) = 0; |
| 134 | 139 |
| 135 DISALLOW_COPY_AND_ASSIGN(UkmRecorder); | 140 DISALLOW_COPY_AND_ASSIGN(UkmRecorder); |
| 136 }; | 141 }; |
| 137 | 142 |
| 138 } // namespace ukm | 143 } // namespace ukm |
| 139 | 144 |
| 140 #endif // SERVICES_METRICS_PUBLIC_CPP_UKM_RECORDER_H_ | 145 #endif // SERVICES_METRICS_PUBLIC_CPP_UKM_RECORDER_H_ |
| OLD | NEW |