| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 118 } |
| 118 | 119 |
| 119 const std::vector<std::unique_ptr<UkmEntry>>& entries_for_testing() const { | 120 const std::vector<std::unique_ptr<UkmEntry>>& entries_for_testing() const { |
| 120 return entries_; | 121 return entries_; |
| 121 } | 122 } |
| 122 | 123 |
| 123 private: | 124 private: |
| 124 friend ::ukm::debug::DebugPage; | 125 friend ::ukm::debug::DebugPage; |
| 125 friend autofill::AutofillMetrics; | 126 friend autofill::AutofillMetrics; |
| 126 friend payments::JourneyLogger; | 127 friend payments::JourneyLogger; |
| 128 friend ContextualSearchRankerLoggerImpl; |
| 127 friend PluginInfoMessageFilter; | 129 friend PluginInfoMessageFilter; |
| 128 friend UkmPageLoadMetricsObserver; | 130 friend UkmPageLoadMetricsObserver; |
| 129 friend translate::TranslateRankerImpl; | 131 friend translate::TranslateRankerImpl; |
| 130 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, AddEntryWithEmptyMetrics); | 132 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, AddEntryWithEmptyMetrics); |
| 131 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, EntryBuilderAndSerialization); | 133 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, EntryBuilderAndSerialization); |
| 132 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, | 134 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, |
| 133 LogsUploadedOnlyWhenHavingSourcesOrEntries); | 135 LogsUploadedOnlyWhenHavingSourcesOrEntries); |
| 134 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, MetricsProviderTest); | 136 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, MetricsProviderTest); |
| 135 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, PersistAndPurge); | 137 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, PersistAndPurge); |
| 136 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, WhitelistEntryTest); | 138 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, WhitelistEntryTest); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 // Weak pointers factory used to post task on different threads. All weak | 213 // Weak pointers factory used to post task on different threads. All weak |
| 212 // pointers managed by this factory have the same lifetime as UkmService. | 214 // pointers managed by this factory have the same lifetime as UkmService. |
| 213 base::WeakPtrFactory<UkmService> self_ptr_factory_; | 215 base::WeakPtrFactory<UkmService> self_ptr_factory_; |
| 214 | 216 |
| 215 DISALLOW_COPY_AND_ASSIGN(UkmService); | 217 DISALLOW_COPY_AND_ASSIGN(UkmService); |
| 216 }; | 218 }; |
| 217 | 219 |
| 218 } // namespace ukm | 220 } // namespace ukm |
| 219 | 221 |
| 220 #endif // COMPONENTS_UKM_UKM_SERVICE_H_ | 222 #endif // COMPONENTS_UKM_UKM_SERVICE_H_ |
| OLD | NEW |