| 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> |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // the provided PrefRegistry. | 85 // the provided PrefRegistry. |
| 86 static void RegisterPrefs(PrefRegistrySimple* registry); | 86 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 87 | 87 |
| 88 using AddEntryCallback = base::Callback<void(std::unique_ptr<UkmEntry>)>; | 88 using AddEntryCallback = base::Callback<void(std::unique_ptr<UkmEntry>)>; |
| 89 | 89 |
| 90 protected: | 90 protected: |
| 91 const std::vector<std::unique_ptr<UkmSource>>& sources_for_testing() const { | 91 const std::vector<std::unique_ptr<UkmSource>>& sources_for_testing() const { |
| 92 return sources_; | 92 return sources_; |
| 93 } | 93 } |
| 94 | 94 |
| 95 const std::vector<std::unique_ptr<UkmEntry>>& entries_for_testing() const { |
| 96 return entries_; |
| 97 } |
| 98 |
| 95 private: | 99 private: |
| 96 friend UkmPageLoadMetricsObserver; | 100 friend UkmPageLoadMetricsObserver; |
| 97 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, AddEntryOnlyWithNonEmptyMetrics); | 101 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, AddEntryOnlyWithNonEmptyMetrics); |
| 98 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, EntryBuilderAndSerialization); | 102 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, EntryBuilderAndSerialization); |
| 99 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, | 103 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, |
| 100 LogsUploadedOnlyWhenHavingSourcesOrEntries); | 104 LogsUploadedOnlyWhenHavingSourcesOrEntries); |
| 101 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, MetricsProviderTest); | 105 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, MetricsProviderTest); |
| 102 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, PersistAndPurge); | 106 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, PersistAndPurge); |
| 103 | 107 |
| 104 // Get a new UkmEntryBuilder object for the specified source ID and event, | 108 // Get a new UkmEntryBuilder object for the specified source ID and event, |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 // Weak pointers factory used to post task on different threads. All weak | 183 // Weak pointers factory used to post task on different threads. All weak |
| 180 // pointers managed by this factory have the same lifetime as UkmService. | 184 // pointers managed by this factory have the same lifetime as UkmService. |
| 181 base::WeakPtrFactory<UkmService> self_ptr_factory_; | 185 base::WeakPtrFactory<UkmService> self_ptr_factory_; |
| 182 | 186 |
| 183 DISALLOW_COPY_AND_ASSIGN(UkmService); | 187 DISALLOW_COPY_AND_ASSIGN(UkmService); |
| 184 }; | 188 }; |
| 185 | 189 |
| 186 } // namespace ukm | 190 } // namespace ukm |
| 187 | 191 |
| 188 #endif // COMPONENTS_UKM_UKM_SERVICE_H_ | 192 #endif // COMPONENTS_UKM_UKM_SERVICE_H_ |
| OLD | NEW |