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

Unified Diff: components/ukm/ukm_service.cc

Issue 2727013002: Add UKM API GetNewSourceID() (Closed)
Patch Set: fix comment Created 3 years, 10 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_service.h ('k') | components/ukm/ukm_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ukm/ukm_service.cc
diff --git a/components/ukm/ukm_service.cc b/components/ukm/ukm_service.cc
index 06c3dbb5f59a60870f12b910eca9dd3289dc12db..80e1c389706ae65fe3b5b299ed8a76a24ccf1a20 100644
--- a/components/ukm/ukm_service.cc
+++ b/components/ukm/ukm_service.cc
@@ -364,6 +364,12 @@ void UkmService::RecordSource(std::unique_ptr<UkmSource> source) {
sources_.push_back(std::move(source));
}
+// static
+int32_t UkmService::GetNewSourceID() {
+ static int32_t next_source_id = 0;
+ return next_source_id++;
+}
+
std::unique_ptr<UkmEntryBuilder> UkmService::GetEntryBuilder(
int32_t source_id,
const char* event_name) {
« no previous file with comments | « components/ukm/ukm_service.h ('k') | components/ukm/ukm_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698