bool ShouldRestrictToWhitelistedSourceIds() const override;
bool ShouldRestrictToWhitelistedEntries() const override;
+ void AddEntry(mojom::UkmEntryPtr entry) override;
+
size_t sources_count() const { return sources().size(); }
size_t entries_count() const { return entries().size(); }
using UkmRecorderImpl::UpdateSourceURL;
+ using UkmRecorderImpl::RecordOtherURL;
// Gets all recorded UkmSource data.
const std::map<ukm::SourceId, std::unique_ptr<UkmSource>>& GetSources()
// Gets UkmSource data for a single SourceId.
const UkmSource* GetSourceForSourceId(ukm::SourceId source_id) const;
+ // Sets a callback that will be called when recording an entry for entry name.
+ void SetOnAddEntryCallback(base::StringPiece entry_name,
+ base::OnceClosure on_add_entry);
+
// Gets all of the entries recorded for entry name.
std::vector<const mojom::UkmEntry*> GetEntriesByName(
base::StringPiece entry_name) const;
base::StringPiece metric_name);
private:
+ uint64_t entry_hash_to_wait_for_ = 0;
+ base::OnceClosure on_add_entry_;
+
DISALLOW_COPY_AND_ASSIGN(TestUkmRecorder);
};