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

Unified Diff: components/ukm/ukm_service.h

Issue 2749433002: Create Field Trial param for whitelisting UKM Entries. (Closed)
Patch Set: add missing } from merge 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/ukm/ukm_entry.h ('k') | components/ukm/ukm_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ukm/ukm_service.h
diff --git a/components/ukm/ukm_service.h b/components/ukm/ukm_service.h
index 613658fbf5ac27e68888cb44304d00e99e523575..125d2ab801c23c80ff427f29d604e7941cd2ba07 100644
--- a/components/ukm/ukm_service.h
+++ b/components/ukm/ukm_service.h
@@ -117,6 +117,7 @@ class UkmService : public base::SupportsWeakPtr<UkmService> {
LogsUploadedOnlyWhenHavingSourcesOrEntries);
FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, MetricsProviderTest);
FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, PersistAndPurge);
+ FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, WhitelistEntryTest);
// Get a new UkmEntryBuilder object for the specified source ID and event,
// which can get metrics added to.
@@ -150,6 +151,9 @@ class UkmService : public base::SupportsWeakPtr<UkmService> {
// Add an entry to the UkmEntry list.
void AddEntry(std::unique_ptr<UkmEntry> entry);
+ // Cache the list of whitelisted entries from the field trial parameter.
+ void StoreWhitelistedEntries();
+
// A weak pointer to the PrefService used to read and write preferences.
PrefService* pref_service_;
@@ -189,6 +193,9 @@ class UkmService : public base::SupportsWeakPtr<UkmService> {
std::map<int32_t, std::unique_ptr<UkmSource>> sources_;
std::vector<std::unique_ptr<UkmEntry>> entries_;
+ // Whitelisted Entry hashes, only the ones in this set will be recorded.
+ std::set<uint64_t> whitelisted_entry_hashes_;
+
// Weak pointers factory used to post task on different threads. All weak
// pointers managed by this factory have the same lifetime as UkmService.
base::WeakPtrFactory<UkmService> self_ptr_factory_;
« no previous file with comments | « components/ukm/ukm_entry.h ('k') | components/ukm/ukm_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698