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 COMPONENTS_UKM_UKM_SERVICE_H_ | 5 #ifndef COMPONENTS_UKM_UKM_SERVICE_H_ |
6 #define COMPONENTS_UKM_UKM_SERVICE_H_ | 6 #define COMPONENTS_UKM_UKM_SERVICE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/feature_list.h" | 13 #include "base/feature_list.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
16 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
18 #include "components/metrics/metrics_provider.h" | 18 #include "components/metrics/metrics_provider.h" |
19 #include "components/metrics/metrics_rotation_scheduler.h" | 19 #include "components/metrics/metrics_rotation_scheduler.h" |
20 #include "components/ukm/ukm_reporting_service.h" | 20 #include "components/ukm/ukm_reporting_service.h" |
21 #include "url/gurl.h" | 21 #include "url/gurl.h" |
22 | 22 |
| 23 class ContextualSearchRankerLoggerImpl; |
23 class PluginInfoMessageFilter; | 24 class PluginInfoMessageFilter; |
24 class PrefRegistrySimple; | 25 class PrefRegistrySimple; |
25 class PrefService; | 26 class PrefService; |
26 class UkmPageLoadMetricsObserver; | 27 class UkmPageLoadMetricsObserver; |
27 | 28 |
28 namespace autofill { | 29 namespace autofill { |
29 class AutofillMetrics; | 30 class AutofillMetrics; |
30 } // namespace autofill | 31 } // namespace autofill |
31 | 32 |
32 namespace translate { | 33 namespace translate { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 return sources_; | 113 return sources_; |
113 } | 114 } |
114 | 115 |
115 const std::vector<std::unique_ptr<UkmEntry>>& entries_for_testing() const { | 116 const std::vector<std::unique_ptr<UkmEntry>>& entries_for_testing() const { |
116 return entries_; | 117 return entries_; |
117 } | 118 } |
118 | 119 |
119 private: | 120 private: |
120 friend autofill::AutofillMetrics; | 121 friend autofill::AutofillMetrics; |
121 friend payments::JourneyLogger; | 122 friend payments::JourneyLogger; |
| 123 friend ContextualSearchRankerLoggerImpl; |
122 friend PluginInfoMessageFilter; | 124 friend PluginInfoMessageFilter; |
123 friend UkmPageLoadMetricsObserver; | 125 friend UkmPageLoadMetricsObserver; |
124 friend translate::TranslateRankerImpl; | 126 friend translate::TranslateRankerImpl; |
125 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, AddEntryWithEmptyMetrics); | 127 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, AddEntryWithEmptyMetrics); |
126 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, EntryBuilderAndSerialization); | 128 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, EntryBuilderAndSerialization); |
127 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, | 129 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, |
128 LogsUploadedOnlyWhenHavingSourcesOrEntries); | 130 LogsUploadedOnlyWhenHavingSourcesOrEntries); |
129 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, MetricsProviderTest); | 131 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, MetricsProviderTest); |
130 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, PersistAndPurge); | 132 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, PersistAndPurge); |
131 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, WhitelistEntryTest); | 133 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, WhitelistEntryTest); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 // Weak pointers factory used to post task on different threads. All weak | 208 // Weak pointers factory used to post task on different threads. All weak |
207 // pointers managed by this factory have the same lifetime as UkmService. | 209 // pointers managed by this factory have the same lifetime as UkmService. |
208 base::WeakPtrFactory<UkmService> self_ptr_factory_; | 210 base::WeakPtrFactory<UkmService> self_ptr_factory_; |
209 | 211 |
210 DISALLOW_COPY_AND_ASSIGN(UkmService); | 212 DISALLOW_COPY_AND_ASSIGN(UkmService); |
211 }; | 213 }; |
212 | 214 |
213 } // namespace ukm | 215 } // namespace ukm |
214 | 216 |
215 #endif // COMPONENTS_UKM_UKM_SERVICE_H_ | 217 #endif // COMPONENTS_UKM_UKM_SERVICE_H_ |
OLD | NEW |