| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 namespace payments { | 44 namespace payments { |
| 45 class JourneyLogger; | 45 class JourneyLogger; |
| 46 } | 46 } |
| 47 | 47 |
| 48 namespace password_manager { | 48 namespace password_manager { |
| 49 class PasswordManagerMetricsRecorder; | 49 class PasswordManagerMetricsRecorder; |
| 50 class PasswordFormMetricsRecorder; | 50 class PasswordFormMetricsRecorder; |
| 51 } // namespace password_manager | 51 } // namespace password_manager |
| 52 | 52 |
| 53 namespace previews { |
| 54 class PreviewsUKMObserver; |
| 55 } |
| 56 |
| 53 namespace ukm { | 57 namespace ukm { |
| 54 | 58 |
| 55 class UkmEntryBuilder; | 59 class UkmEntryBuilder; |
| 56 class UkmInterface; | 60 class UkmInterface; |
| 57 class TestRecordingHelper; | 61 class TestRecordingHelper; |
| 58 | 62 |
| 59 // This feature controls whether UkmService should be created. | 63 // This feature controls whether UkmService should be created. |
| 60 METRICS_EXPORT extern const base::Feature kUkmFeature; | 64 METRICS_EXPORT extern const base::Feature kUkmFeature; |
| 61 | 65 |
| 62 typedef int64_t SourceId; | 66 typedef int64_t SourceId; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 93 friend UkmPageLoadMetricsObserver; | 97 friend UkmPageLoadMetricsObserver; |
| 94 friend LocalNetworkRequestsPageLoadMetricsObserver; | 98 friend LocalNetworkRequestsPageLoadMetricsObserver; |
| 95 friend translate::TranslateRankerImpl; | 99 friend translate::TranslateRankerImpl; |
| 96 friend TestRecordingHelper; | 100 friend TestRecordingHelper; |
| 97 friend UkmInterface; | 101 friend UkmInterface; |
| 98 friend content::MediaInternals; | 102 friend content::MediaInternals; |
| 99 friend content::RenderFrameImpl; | 103 friend content::RenderFrameImpl; |
| 100 friend content::RenderWidgetHostLatencyTracker; | 104 friend content::RenderWidgetHostLatencyTracker; |
| 101 friend password_manager::PasswordManagerMetricsRecorder; | 105 friend password_manager::PasswordManagerMetricsRecorder; |
| 102 friend password_manager::PasswordFormMetricsRecorder; | 106 friend password_manager::PasswordFormMetricsRecorder; |
| 107 friend previews::PreviewsUKMObserver; |
| 103 friend resource_coordinator::CoordinationUnitManager; | 108 friend resource_coordinator::CoordinationUnitManager; |
| 104 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, AddEntryWithEmptyMetrics); | 109 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, AddEntryWithEmptyMetrics); |
| 105 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, EntryBuilderAndSerialization); | 110 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, EntryBuilderAndSerialization); |
| 106 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, | 111 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, |
| 107 LogsUploadedOnlyWhenHavingSourcesOrEntries); | 112 LogsUploadedOnlyWhenHavingSourcesOrEntries); |
| 108 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, MetricsProviderTest); | 113 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, MetricsProviderTest); |
| 109 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, PersistAndPurge); | 114 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, PersistAndPurge); |
| 110 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, WhitelistEntryTest); | 115 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, WhitelistEntryTest); |
| 111 | 116 |
| 112 // Get a new UkmEntryBuilder object for the specified source ID and event, | 117 // Get a new UkmEntryBuilder object for the specified source ID and event, |
| 113 // which can get metrics added to. | 118 // which can get metrics added to. |
| 114 // | 119 // |
| 115 // This API being private is intentional. Any client using UKM needs to | 120 // This API being private is intentional. Any client using UKM needs to |
| 116 // declare itself to be a friend of UkmService and go through code review | 121 // declare itself to be a friend of UkmService and go through code review |
| 117 // process. | 122 // process. |
| 118 std::unique_ptr<UkmEntryBuilder> GetEntryBuilder(SourceId source_id, | 123 std::unique_ptr<UkmEntryBuilder> GetEntryBuilder(SourceId source_id, |
| 119 const char* event_name); | 124 const char* event_name); |
| 120 | 125 |
| 121 private: | 126 private: |
| 122 // Add an entry to the UkmEntry list. | 127 // Add an entry to the UkmEntry list. |
| 123 virtual void AddEntry(mojom::UkmEntryPtr entry) = 0; | 128 virtual void AddEntry(mojom::UkmEntryPtr entry) = 0; |
| 124 | 129 |
| 125 DISALLOW_COPY_AND_ASSIGN(UkmRecorder); | 130 DISALLOW_COPY_AND_ASSIGN(UkmRecorder); |
| 126 }; | 131 }; |
| 127 | 132 |
| 128 } // namespace ukm | 133 } // namespace ukm |
| 129 | 134 |
| 130 #endif // SERVICES_METRICS_PUBLIC_CPP_UKM_RECORDER_H_ | 135 #endif // COMPONENTS_UKM_PUBLIC_UKM_RECORDER_H_ |
| OLD | NEW |