Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: components/ukm/ukm_service.h

Issue 2719823003: Convert first contentful paint logging to the new UKM client API (Closed)
Patch Set: renames Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « components/ukm/ukm_entry.cc ('k') | components/ukm/ukm_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 // the provided PrefRegistry. 87 // the provided PrefRegistry.
88 static void RegisterPrefs(PrefRegistrySimple* registry); 88 static void RegisterPrefs(PrefRegistrySimple* registry);
89 89
90 using AddEntryCallback = base::Callback<void(std::unique_ptr<UkmEntry>)>; 90 using AddEntryCallback = base::Callback<void(std::unique_ptr<UkmEntry>)>;
91 91
92 protected: 92 protected:
93 const std::vector<std::unique_ptr<UkmSource>>& sources_for_testing() const { 93 const std::vector<std::unique_ptr<UkmSource>>& sources_for_testing() const {
94 return sources_; 94 return sources_;
95 } 95 }
96 96
97 const std::vector<std::unique_ptr<UkmEntry>>& entries_for_testing() const {
98 return entries_;
99 }
100
97 private: 101 private:
98 friend UkmPageLoadMetricsObserver; 102 friend UkmPageLoadMetricsObserver;
99 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, AddEntryOnlyWithNonEmptyMetrics); 103 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, AddEntryOnlyWithNonEmptyMetrics);
100 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, EntryBuilderAndSerialization); 104 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, EntryBuilderAndSerialization);
101 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, 105 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest,
102 LogsUploadedOnlyWhenHavingSourcesOrEntries); 106 LogsUploadedOnlyWhenHavingSourcesOrEntries);
103 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, MetricsProviderTest); 107 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, MetricsProviderTest);
104 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, PersistAndPurge); 108 FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, PersistAndPurge);
105 109
106 // Get a new UkmEntryBuilder object for the specified source ID and event, 110 // Get a new UkmEntryBuilder object for the specified source ID and event,
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 // Weak pointers factory used to post task on different threads. All weak 184 // Weak pointers factory used to post task on different threads. All weak
181 // pointers managed by this factory have the same lifetime as UkmService. 185 // pointers managed by this factory have the same lifetime as UkmService.
182 base::WeakPtrFactory<UkmService> self_ptr_factory_; 186 base::WeakPtrFactory<UkmService> self_ptr_factory_;
183 187
184 DISALLOW_COPY_AND_ASSIGN(UkmService); 188 DISALLOW_COPY_AND_ASSIGN(UkmService);
185 }; 189 };
186 190
187 } // namespace ukm 191 } // namespace ukm
188 192
189 #endif // COMPONENTS_UKM_UKM_SERVICE_H_ 193 #endif // COMPONENTS_UKM_UKM_SERVICE_H_
OLDNEW
« no previous file with comments | « components/ukm/ukm_entry.cc ('k') | components/ukm/ukm_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698