Index: components/ukm/ukm_service.h |
diff --git a/components/ukm/ukm_service.h b/components/ukm/ukm_service.h |
index 1775d16a1b7fb69218939aeb0f1686f9e12e7306..98984f56cc96f8f84f1a7e108e0740a0bb36e413 100644 |
--- a/components/ukm/ukm_service.h |
+++ b/components/ukm/ukm_service.h |
@@ -83,6 +83,10 @@ class UkmService : public base::SupportsWeakPtr<UkmService> { |
// the provided PrefRegistry. |
static void RegisterPrefs(PrefRegistrySimple* registry); |
+ // Allocates a new source id. The allocated source id is guaranteed to be |
+ // unique for the duration of this browser session. |
+ static int32_t NewSourceId(); |
+ |
using AddEntryCallback = base::Callback<void(std::unique_ptr<UkmEntry>)>; |
protected: |
@@ -90,6 +94,10 @@ class UkmService : public base::SupportsWeakPtr<UkmService> { |
return sources_; |
} |
+ const std::vector<std::unique_ptr<UkmEntry>>& entries_for_testing() const { |
+ return entries_; |
+ } |
+ |
private: |
friend UkmPageLoadMetricsObserver; |
FRIEND_TEST_ALL_PREFIXES(UkmServiceTest, AddEntryOnlyWithNonEmptyMetrics); |