Commit bdbbd722 authored by Russ Hamilton's avatar Russ Hamilton Committed by Commit Bot

Add OnStoreRecordingsInReport method to UKMEntryFilter.

This method is needed so that we can leverage the filter
for rate-limiting and deduplicating metrics on a per-report
basis.

Bug: 1112787
Change-Id: I230f06eff4c00479387ad1dcc88bf51a3a2034e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2363688Reviewed-by: default avatarBrian White <bcwhite@chromium.org>
Commit-Queue: Russ Hamilton <behamilton@google.com>
Cr-Commit-Position: refs/heads/master@{#800197}
parent a4561e70
......@@ -44,6 +44,10 @@ class UkmEntryFilter {
virtual bool FilterEntry(
mojom::UkmEntry* entry,
base::flat_set<uint64_t>* removed_metric_hashes) const = 0;
// UkmService invokes this method every time a report is generated.
//
virtual void OnStoreRecordingsInReport() const {}
};
} // namespace ukm
......
......@@ -530,6 +530,11 @@ void UkmRecorderImpl::StoreRecordingsInReport(Report* report) {
}
}
source_counts_proto->set_entryless_sources(num_sources_entryless);
// Notify observers that a report was generated.
if (entry_filter_) {
entry_filter_->OnStoreRecordingsInReport();
}
}
bool UkmRecorderImpl::ShouldRestrictToWhitelistedSourceIds() const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment